CVE-2023-45666

Possible double-free or memory leak in stbi__load_gif_main in stb_image

Description

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

Category

7.3
CVSS
Severity: High
CVSS 3.1 •
EPSS 0.12%
Third-Party Advisory github.com Third-Party Advisory github.com Third-Party Advisory github.com
Affected: nothings stb
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-45666?
CVE-2023-45666 has been scored as a high severity vulnerability.
How to fix CVE-2023-45666?
To fix CVE-2023-45666, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2023-45666 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2023-45666 is being actively exploited. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-45666?
CVE-2023-45666 affects nothings stb.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.