CVE-2021-42716

stb: heap-based buffer overflow in stb_image PNM loader

Published Oct 21, 2021 CVSS 3.1 · 7.1 High EPSS 1.5% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2021-29676 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.
History

No history.

Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Aug 4, 2024, 3:38 AM
Reserved
Oct 19, 2021, 12:00 AM
Status
Modified
Published
Oct 21, 2021, 7:15 PM
Modified
Jun 17, 2026, 4:10 AM
Severity
Moderate
Public date
Jul 14, 2021, 12:00 AM