Skip to content
OpenAdvisories
High · 7.3 CVE-2023-45664 EUVD-2023-49955

Double-free in stbi__load_gif_main_outofmem in stb_image

Published Oct 20, 2023 · Updated Feb 13, 2025 · Assigned by GitHub_M

Description

stb_image is a single file MIT licensed library for processing images. A crafted image file can trigger `stbi__load_gif_main_outofmem` attempt to double-free the out variable. This happens in `stbi__load_gif_main` because when the `layers * stride` value is zero the behavior is implementation defined, but common that realloc frees the old memory and returns null pointer. Since it attempts to double-free the memory a few lines below the first “free”, the issue can be potentially exploited only in a multi-threaded environment. In the worst case this may lead to code execution.

Affected products

VendorProductAffectedFixed
nothings stb <= 2.28 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 libstb No fix yet —
Debian 13 libstb No fix yet —
Debian 12 libstb No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 libstb No fix yet —
Ubuntu 26.04 LTS libstb No fix yet —
Ubuntu 25.10 libstb No fix yet —
Ubuntu 24.04 LTS libstb No fix yet —
Ubuntu 22.04 LTS libstb No fix yet —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS libstb No fix yet —
ReleasePackageFixed inAdvisory
Alpine v3.24 stb 0_git20231012-r0 —
Alpine v3.23 stb 0_git20231012-r0 —
Alpine v3.22 stb 0_git20231012-r0 —
Alpine v3.21 stb 0_git20231012-r0 —
Alpine v3.20 stb 0_git20231012-r0 —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 stb 0_git20231012-r0 —

References