# GHSA-ppjr-267j-5p9x: NULL pointer derefernce in `stb_image`

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2023-03-19T12:00:00.000Z
- Modified: 2023-11-08T04:21:46.866Z
- Also known as: RUSTSEC-2023-0021
- Weaknesses: CWE-476

## 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.

(As written by GitHub Advisory Database.)

## Affected

- stb_image (crates.io): before 0.2.5; from 0.0.0-0 before 0.2.5

## References

- <https://github.com/servo/rust-stb-image/pull/102> (web)
- <https://github.com/servo/rust-stb-imag> (package)
- <https://rustsec.org/advisories/RUSTSEC-2023-0021.html> (advisory, web)
- <https://crates.io/crates/stb_image> (package)

## Sources

- GitHub Advisory Database: [GHSA-ppjr-267j-5p9x](https://github.com/advisories/GHSA-ppjr-267j-5p9x), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2023-0021](https://rustsec.org/advisories/RUSTSEC-2023-0021.html), CC0-1.0, modified 2023-11-08

---

Page: https://cve.day/GHSA-ppjr-267j-5p9x · Whole record: https://cve.day/GHSA-ppjr-267j-5p9x.json · Rebuilt by cve.day 2026-11-25T22:56:43.142Z
