HOMEVULNERABILITIESCVE-2021-42716
HIGH

CVE-2021-42716

CWE-120Published: October 21, 2021· Updated: Jun 17, 2026

7.1
CVSS v3.1

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

NVD Source

Technical Analysis

CVE-2021-42716 requires local access, meaning attackers must already have a foothold on the target system.

Exploitation does not require any privileges, though user interaction (Required) is needed, which slightly reduces the risk of mass automated attacks.

A successful exploit results in complete confidentiality breach (data exposure), availability disruption (denial of service), with a CVSS base score of 7.1.

CVSS v3.1 Vector Breakdown

Exploitability
Attack VectorLocal
Attack ComplexityLow
Privileges Req.None
User InteractionRequired
ScopeUnchanged
Impact
ConfidentialityHigh
IntegrityNone
AvailabilityHigh
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H

Affected Vendors & Products

Fedora1 product(s)
fedora
nothings1 product(s)
stb image.h
Source: NVD CPE · 4 total CPE entries

Exploit & PoC Resources

NO KNOWN EXPLOITNo public exploit confirmed at this time
External links open in a new tab. Always verify in a controlled environment before use.

Official Patches & Advisories

All References (24)

https://github.com/nothings/stb/issues/1166Exploit · Issue Tracking · Third Party Advisory
https://github.com/nothings/stb/issues/1225Exploit · Issue Tracking · Third Party Advisory
https://github.com/nothings/stb/issues/1166Exploit · Issue Tracking · Third Party Advisory
https://github.com/nothings/stb/issues/1225Exploit · Issue Tracking · Third Party Advisory

Quick Facts

CVE IDCVE-2021-42716
CVSS Score7.1 / 10
SeverityHIGH
WeaknessCWE-120
CISA KEVNo
Affected2 vendor(s)
PublishedOct 21, 2021

Related CVEs (CWE-120)

Recommended Actions

  • Apply vendor patches immediately
  • Monitor CVE-2021-42716 in threat intel feeds
  • Review IDS/IPS signatures for exploitation attempts
Data sourced from NVD (NIST), CISA KEV, and EPSS (FIRST). Analysis generated by CTIWATCH.COM. CVE data is provided under the NVD usage policy.