1. Home
  2. Vulnerabilities
  3. CVE-2021-42716

CVE-2021-42716

An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as…

Published 21 Oct 2021 · modified 17 Jun 2026 · Sources: NVD, EPSS (FIRST)

Medium 52/100

Summary

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 products and versions

Fedoraproject (3 line(s))
Fedoraproject
ProductVersionsFixed inSource
Fedora 33 — NVD
Fedora 34 — NVD
Fedora 35 — NVD
Nothings (1 line(s))
Nothings
ProductVersionsFixed inSource
Stb image.h 2.27 — NVD

Fix

Not provided by the vendor.

Workaround

No workaround provided.

Check whether you are affected

Exploit reported by sources

These links are tagged “exploit” by the NVD or CVE.org. We have neither verified nor copied them; open with care.

Timeline

  1. — CVE published (cve)

References

Data provenance

Status
NVD
Publication date
NVD
Description
NVD
CVSS score
NVD
Weakness (CWE)
NVD
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H (CVSS 3.1, NVD)
Weakness
CWE-120 · Corruption mémoire

How this data is obtained and calculated