CVE-2021-42716
JSON

7.1high

An issue was discovered in stb stbimage.h 2.27.

Severity
7.1high CVSS:3.1 by NVD
Exploit likelihood
1.46% (higher than 74% of CVEs; EPSS, by FIRST)
Published
Last changed
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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
nothings stb_image.h2.27NVD
fedoraproject fedora33, 34, 35NVD

All scores

NVD7.1high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
NVD5.8medium CVSS:2.0AV:N/AC:M/Au:N/C:P/I:N/A:P

Classification

What each source says

CVE List

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 (es)

Se ha detectado un problema en stb stb_image.h versión 2.27. El cargador de PNM interpretaba incorrectamente los archivos PGM de 16 bits como de 8 bits cuando los convertía a RGBA, conllevando a un desbordamiento del búfer cuando se reinterpreta posteriormente el resultado como un búfer de 16 bits. Un atacante podría potencialmente bloquear un servicio usando stb_image, o leer hasta 1024 bytes de datos de la pila no consecutivos sin control sobre la ubicación de lectura

References

https://github.com/nothings/stb/issues/1166exploit, issue-tracking, third-party-advisory
https://github.com/nothings/stb/pull/1223third-party-advisory
https://github.com/nothings/stb/issues/1225exploit, issue-tracking, 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

SourceRecordLicence
CVE ListCVE-2021-42716 changed 2024-08-04CVE Terms of Use
NVDCVE-2021-42716 changed 2026-06-17Public domain