CVE-2021-42716An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA,…
- 7.1HighCVSS base score
- 1.5%Exploitation in 30 daysEPSS · top 26% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.
Timeline
ID reserved
By mitre
- 2 days later
· 2 days later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | High7.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H |
- EPSS (exploitation in 30 days)
- 1.5% · top 26% of all CVEs (18 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.1.
Affected products
n/a
- affected n/a
References
References12
- https://github.com/nothings/stb/issues/1166 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/nothings/stb/pull/1223 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/nothings/stb/issues/1225 (opens in a new tab)x_refsource_MISCx_transferred
- FEDORA-2021-001f25d986 (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-d1446cd1ac (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-f8ba4a690e (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-0511a38484 (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-082bea5b34 (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-3fc69d203c (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-8ea648186c (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-16d848834d (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2022-832689aa6b (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-29676 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-42716)Record last updated .