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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| nothings stb_image.h | 2.27 | NVD |
| fedoraproject fedora | 33, 34, 35 | NVD |
All scores
| NVD | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H |
| NVD | 5.8medium CVSS:2.0 | AV: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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-42716 changed 2024-08-04 | CVE Terms of Use |
| NVD | CVE-2021-42716 changed 2026-06-17 | Public domain |