CVE-2021-42716

HIGH

Nothings Stb Image.h - Buffer Overflow

Title source: rule
STIX 2.1

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.

References (12)

Core 12
Core References
Exploit, Issue Tracking, Third Party Advisory x_refsource_misc
https://github.com/nothings/stb/issues/1166
Third Party Advisory x_refsource_misc
https://github.com/nothings/stb/pull/1223
Exploit, Issue Tracking, Third Party Advisory x_refsource_misc
https://github.com/nothings/stb/issues/1225

Scores

CVSS v3 7.1
EPSS 0.0025
EPSS Percentile 48.3%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H

Details

CWE
CWE-120
Status published
Products (4)
fedoraproject/fedora 33
fedoraproject/fedora 34
fedoraproject/fedora 35
nothings/stb_image.h 2.27
Published Oct 21, 2021
Tracked Since Feb 18, 2026