Possible double-free or memory leak in stbi__load_gif_main in stb_image
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- No fix listed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA. Impact type from CWE-415 and the CVSS impact.
Summary
stb_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
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
Remediation
No fixed version listed by the sources yet.
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2023-45666
References
Advisory 3
Other 3
- https://lists.fedoraproject.org/archives/list/[email protected]/message/UVQ7ONFH5GWLMXYEAJG32A3EUKUCEVCR/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/QVABVF4GEM6BYD5L4L64RCRSXUHY6LGN/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/NMXKOKPP4BKTNUTF5KSRDQAWOUILQZNO/
More nothings Stb Image.h vulnerabilities
- TI-2023-24465 Double-free in stbi__load_gif_main_outofmem in stb_image CVSS 3.1HIGH 8.8
- TI-2023-24463 Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image CVSS 3.1HIGH 8.1
- TI-2023-24467 Null pointer dereference because of an uninitialized variable in stb_image CVSS 3.1HIGH 7.5
- TI-2023-24462 Wild address read in stbi__gif_load_next in stb_image CVSS 3.1HIGH 7.1
- TI-2023-23171 Double Free vulnerability in Nothings Stb Image.h v.2.28 allows a remote attacker to… CVSS 3.1MEDIUM 6.5
- TI-2023-24464 Disclosure of uninitialized memory in stbi__tga_load in stb_image CVSS 3.1MEDIUM 5.5
Sources
- CVE-2023-45666 · CVE Program
- CVE-2023-45666 · NVD
- FIRST EPSS
- CVE-2023-45666 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences