CVE-2023-45666
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 · uneditedstb_image is a single file MIT licensed library for processing images. It may look like `stbi__load_gif_main` doesn’t give guarantees about the content of output value `*delays` upon failure. Although it sets `*delays` to zero at the beginning, it doesn’t do it in case the image is not recognized as GIF and a call to `stbi__load_gif_main_outofmem` only frees possibly allocated memory in `*delays` without resetting it to zero. Thus it would be fair to say the caller of `stbi__load_gif_main` is responsible to free the allocated memory in `*delays` only if `stbi__load_gif_main` returns a non null value. However at the same time the function may return null value, but fail to free the memory in `*delays` if internally `stbi__convert_format` is called and fails. Thus the issue may lead to a memory leak if the caller chooses to free `delays` only when `stbi__load_gif_main` didn’t fail or to a double-free if the `delays` is always freed
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 · high confidencestb_image's stbi__load_gif_main has a memory management flaw where *delays is not reset to zero after being freed in the outofmem path, and memory is not properly freed when stbi__convert_format fails internally. This can lead to memory leaks or double-free conditions depending on caller behavior, with use-after-free possible if the caller attempts to use the freed pointer.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 2.28CVSS 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
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
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 checksWork through these to decide whether this CVE applies to you.
-
Locate stb_image.h in your environmentSearch for files named stb_image.h, stb_image.c, or similar in your project dependencies, libraries, or included header directories.Affected if The file exists and is used by your application
-
Identify the installed version of stb_imageOpen the stb_image.h file and search for a version definition such as STB_IMAGE_VERSION, STB_IMAGE_VERSION_STRING, or a comment/note indicating the version number (typically near the top of the file).Affected if The version is exactly 2.28 (version 2.28)
-
Determine if GIF loading is usedSearch your codebase for calls to GIF-related stb_image functions such as stbi_load_gif, stbi_image_load, or similar functions that load GIF images.Affected if Your code loads GIF images using stb_image functions
-
Inspect the stbi__load_gif_main function for the memory flawOpen stb_image.h and locate the function stbi__load_gif_main. Within this function, look for the 'outofmem' label/path where delays is freed, and check if *delays is set to NULL after freeing. Also check if stbi__convert_format failure paths properly free delays before returning.Affected if The code shows *delays is NOT set to NULL after being freed in the outofmem path, OR memory is not freed when stbi__convert_format fails internally
Your environment is affected if you are using stb_image.h version 2.28 and your code loads GIF images using stb_image functions, with the vulnerable code paths in stbi__load_gif_main being reached.
Generated from the published advisory. Verify against your own configuration.
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 dataEnsure *delays is set to NULL after freeing in all error paths, particularly in stbi__load_gif_main_outofmem and when stbi__convert_format fails. Update caller guidance to always check and free delays regardless of return value.
- Consultation1.0 h
- Implementation2.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,664.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2023-45666 — 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2023-45666 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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