# CVE-2021-42716: An issue was discovered in stb stbimage.h 2.27.

- Severity: High 7.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.46%, higher than 74% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-10-21T18:36:39.000Z
- Modified: 2026-06-17T04:10:00.077Z
- Weaknesses: CWE-120
- Assigned by: mitre

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

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- nothings stb_image.h: 2.27
- fedoraproject fedora: 33; 34; 35

## Every score

- NVD: CVSS:3.1 7.1 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H`
- NVD: CVSS:2.0 5.8 Medium `AV:N/AC:M/Au:N/C:P/I:N/A:P`

## References

- <https://github.com/nothings/stb/issues/1166> (exploit, issue-tracking, third-party-advisory)
- <https://github.com/nothings/stb/issues/1225> (exploit, issue-tracking, third-party-advisory)
- <https://github.com/nothings/stb/pull/1223> (third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/G2M5CRSGPRF7G3YB5CLU4FXW7ANNHAYT/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ID6II3RIKAMVGVMC6ZAQIXXYYDMTVC4N/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BEGXBDEMTFGINETMJENBZ6SCHVEJQJSY/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CI23LXPEV2GCDQTJSKO6CIILBDTI3R42/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FTZXHFZD36BGE5P6JF252NZZLKMGCY4T/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VP2YEXEAJWI76FPM7D7VXHWD3WESQEYC/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3TDGZFLBOP27LZKLH45WQLSNPSPP7S7Z/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AF2CNP4FVC6LDKNOO4WDCGNDYIP3MPK6/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TXX76TJMZBPN3NU542MGN6B7C7QHRFGB/> (vendor-advisory)

## Sources

- CVE List: [CVE-2021-42716](https://www.cve.org/CVERecord?id=CVE-2021-42716), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2021-42716](https://nvd.nist.gov/vuln/detail/CVE-2021-42716), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-42716 · Whole record: https://cve.day/CVE-2021-42716.json · Rebuilt by cve.day 2026-11-25T22:58:04.720Z
