Skip to content
Noroxi
NVD / CVE Program· CNA mitre

CVE-2021-42716: An issue was discovered in stb stb_image.h 2.27.

HighCVSS 7.1 · v3.1—No exploit Fix available

Noroxi assessment

Priority: Monitor (action score 28/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Probability of exploitation in the next 30 days: 1.4% (FIRST EPSS); higher than 73.8% of all records.
  • Someone with local access to the system can trigger it. No account or password is required. A user must open a link or visit a page. No special conditions are required; it is repeatable.
  • Fixed version: libstb (Debian:13) 0.0~git20230129.5736b15+ds-1; stb (openSUSE:Leap 15.3) 2.32.1549563867.59e9702-bp153.2.3.1; zxing-cpp (openSUSE:Leap 15.3) 1.2.0-9.7.1.

Low priority for now. Upgrade to libstb (Debian:13) 0.0~git20230129.5736b15+ds-1; stb (openSUSE:Leap 15.3) 2.32.1549563867.59e9702-bp153.2.3.1; zxing-cpp (openSUSE:Leap 15.3) 1.2.0-9.7.1 or later.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: NVD · CVE.org · FIRST EPSS

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.

Published
Oct 21, 2021
Updated
Jun 17, 2026
EPSS
1.4% · 73th percentile

Report tools

JSON

Action score

28

Monitor

Low priority for now.

CVSS
28 / 40 · 7.1 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · 1.4%

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • A fix has been released

If any of these changes, we'll tell you in the daily email digest.

Follow CVE-2021-42716

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools

Sign up with email · Have an account? Sign in

Free account, no card. Unfollow any time.

Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
nothingsstb image.h
fedoraprojectfedora

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • fedoraproject fedora33
  • fedoraproject fedora34
  • fedoraproject fedora35
  • nothings stb image.h2.27

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
Debian:12libstbfrom 0—
Debian:13libstbbefore 0.0~git20230129.5736b15+ds-10.0~git20230129.5736b15+ds-1
openSUSE:Leap 15.3stbbefore 2.32.1549563867.59e9702-bp153.2.3.12.32.1549563867.59e9702-bp153.2.3.1
openSUSE:Leap 15.3zxing-cppbefore 1.2.0-9.7.11.2.0-9.7.1
SUSE:Linux Enterprise Module for Package Hub 15 SP3zxing-cppbefore 1.2.0-9.7.11.2.0-9.7.1
SUSE:Linux Enterprise Software Development Kit 12 SP5zxing-cppbefore 1.2.0-8.6.11.2.0-8.6.1
SUSE:Package Hub 15 SP3stbbefore 2.32.1549563867.59e9702-bp153.2.3.12.32.1549563867.59e9702-bp153.2.3.1

Other highest-scoring records for the same primary product.

  • CVE-2023-45666Possible double-free or memory leak in stbi__load_gif_main in stb_image
    39Monitor
  • CVE-2023-45664Double-free in stbi__load_gif_main_outofmem in stb_image
    35Monitor
  • CVE-2022-28042stb_image.h v2.27 was discovered to contain an heap-based use-after-free via the function stbi__jpeg_huff_decode.
    35Monitor

Published before and after this one in the same product

  • ← EarlierCVE-2019-20056Dec 29, 2019 · stb_image.h (aka the stb image loader) 2.23, as used in libsixel and other products, has an assertion failure in stbi__shiftsigned.
    26Monitor
  • ← EarlierCVE-2021-42715Oct 21, 2021 · An issue was discovered in stb stb_image.h 1.33 through 2.27.
    22Monitor
  • Later →CVE-2022-28041Apr 15, 2022 · stb_image.h v2.27 was discovered to contain an integer overflow via the function stbi__jpeg_decode_block_prog_dc.
    27Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
debian:libstb0.0~git20230129.5736b15+ds-1 · Debian:13Package registry (OSV)
opensuse:stb2.32.1549563867.59e9702-bp153.2.3.1 · openSUSE:Leap 15.3Package registry (OSV)
opensuse:zxing-cpp1.2.0-9.7.1 · openSUSE:Leap 15.3Package registry (OSV)
suse:stb2.32.1549563867.59e9702-bp153.2.3.1 · SUSE:Package Hub 15 SP3Package registry (OSV)
suse:zxing-cpp1.2.0-9.7.1 · SUSE:Linux Enterprise Module for Package Hub 15 SP3Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Someone with local access to the system can trigger it.
  • No account or password is required.
  • A user must open a link or visit a page.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
high · data can be read
Integrity
none
Availability
high · the service can be disrupted
Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality impact
High
Integrity impact
None
Availability impact
High

CVSS vector

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H

nvd-primary

Root cause

When data is copied, the source length is not compared with the size of the destination buffer. Excess data overwrites adjacent memory.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

c
char buf[256];memcpy(buf, pkt->data, pkt->len);

Fixed

c
char buf[256];if (pkt->len > sizeof(buf)) {  return -EINVAL;}memcpy(buf, pkt->data, pkt->len);

References

All records