Memory Buffer Bounds ErrorWeakness · CWE-119

CVE-2026-5186

MEDIUM · 5.3 CVSS v3.1 Published 2026-03-31
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
55/100
Remediation priority · Elevated
Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
A weakness has been identified in Nothings stb up to 2.30. This impacts the function stbi__load_gif_main of the file stb_image.h of the component Multi-frame GIF File Handler. This manipulation causes double free. The attack requires local access. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

A double-free vulnerability exists in stb_image.h's stbi__load_gif_main function when processing multi-frame GIF files. The vulnerability allows a local attacker to trigger a double-free condition by supplying a specially crafted GIF file, potentially leading to heap corruption, denial of service, or potentially code execution depending on memory state.

MitigationUpdate stb library to a version beyond 2.30 if available; otherwise validate all GIF input before processing or replace with an alternative image library that has active security maintenance.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Locate stb_image.h in your environment
    Search for stb_image.h files in your project directories, dependencies, or installed libraries using 'find . -name stb_image.h' or check your package manager for stb libraries
    Affected if stb_image.h is present and used in the environment
  2. Identify the stb_image version
    Open stb_image.h and look for a version definition near the top of the file (typically a comment like 'version 2.xx' or a #define STB_VERSION)
    Affected if The version is 2.30 or earlier, or no version string is visible (indicating an older release)
  3. Determine if GIF processing is used
    Search your codebase for calls to stbi_load, stbi_load_gif, stbi_image_load, or similar stb_image functions that handle GIF files
    Affected if Your application code loads or processes GIF image files using stb_image functions
  4. Verify multi-frame GIF input is possible
    Check if your application accepts GIF files from untrusted sources (user uploads, network input, file processing of arbitrary GIFs)
    Affected if Your application accepts and processes GIF files from external or untrusted sources without prior validation
  5. Confirm the vulnerable code path exists
    In stb_image.h, locate the stbi__load_gif_main function (search for 'stbi__load_gif_main') to confirm the function is present in your version
    Affected if The stbi__load_gif_main function exists in your copy of stb_image.h (this function handles multi-frame GIF decoding)
  6. Review memory allocation patterns
    If possible, run your application with a memory debugging tool (ASan, Valgrind) while processing a multi-frame GIF to observe any double-free behavior
    Affected if Memory debugging tools report a double-free or heap corruption condition when processing multi-frame GIF files

Your environment is affected if stb_image.h version 2.30 or earlier is in use AND your application processes multi-frame GIF files from any untrusted source, as the stbi__load_gif_main function contains the double-free vulnerability.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Update stb library to a version beyond 2.30 if available; otherwise validate all GIF input before processing or replace with an alternative image library that has active security maintenance.

Have this fixed Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing8.0 h
  • Review / QA4.0 h
24.0 hours of engineering $4,160
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $6,656.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-5186 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-5186 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data