cve.bz

CVE-2021-42716 Classic Buffer Overflow

7.1 highExploit referenceEPSS 1.5%

High (7.1). EPSS 1.5% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

7.1 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
EPSS
1.5% (unchanged from 1.5% a week ago; 1.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 74th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-120 Buffer Copy without Checking Size of Input (Classic Buffer Overflow)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-42716 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-42716?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-42716?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-42716 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
nothings:stb_image.h2.27
fedoraproject:fedora33
fedoraproject:fedora34
fedoraproject:fedora35

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12libstbno fix listedDEBIAN-CVE-2021-42716
Debian13, 14libstb0.0~git20230129.5736b15+ds-1DEBIAN-CVE-2021-42716
Ubuntu20.04:LTS, 22.04:LTS, 24.04:LTS and 3 morelibstbno fix listedUBUNTU-CVE-2021-42716
SUSELinux Enterprise Module for Package Hub 15 SP3, Linux Enterprise Workstation Extension 15 SP3zxing-cpp1.2.0-9.7.1SUSE-SU-2022:0157-1
SUSELinux Enterprise Software Development Kit 12 SP5, Linux Enterprise Workstation Extension 12 SP5zxing-cpp1.2.0-8.6.1SUSE-SU-2022:0163-1
SUSEPackage Hub 15 SP3stb2.32.1549563867.59e9702-bp153.2.3.1openSUSE-SU-2022:0018-1
openSUSELeap 15.3stb2.32.1549563867.59e9702-bp153.2.3.1openSUSE-SU-2022:0018-1
openSUSELeap 15.3zxing-cpp1.2.0-9.7.1openSUSE-SU-2022:0157-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This flaw does not affect the versions of cogl shipped with Red Hat Enterprise Linux 7 or 8 because the affected code is not shipped in those packages. This flaw is out of support scope for Red Hat Enterprise Linux 6.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6clutterOut of support scope
Red Hat Enterprise Linux 7coglNot affected
Red Hat Enterprise Linux 7compat-cogl114Not affected
Red Hat Enterprise Linux 8coglNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-42716.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-120 (13).

References

Check your stackJSON