GHSA-ppjr-267j-5p9x NULL pointer dereference in `stb_image`
A NULL pointer dereference in the stb_image Rust crate allows attackers to cause a denial of service by providing a malformed image file.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is GHSA-ppjr-267j-5p9x?
GHSA-ppjr-267j-5p9x is a vulnerability in stb_image, published on 19 Mar 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
A bug in error handling in the stb_image C library could cause a NULL pointer dereference when attempting to load an invalid or unsupported image file. This is fixed in version 0.2.5 and later of the stb_image Rust crate, by patching the C code to correctly handle NULL pointers.
Thank you to GitHub user 0xdd96 for finding and fixing this vulnerability.
Which versions are affected by GHSA-ppjr-267j-5p9x?
3 open source packages ship an affected version, including stb_image.
| Package | Affected | Fixed in |
|---|---|---|
stb_image crates.io | All versions | 0.2.5 |
stb_image crates.io | All versions | 0.2.5 |
stb_image crates.io | From 0.0.0-0 | 0.2.5 |
How do I fix GHSA-ppjr-267j-5p9x?
Upgrade stb_image to 0.2.5 or later.
Is GHSA-ppjr-267j-5p9x being exploited?
There is no known exploitation of GHSA-ppjr-267j-5p9x in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2023-0021.