Every CVE Search/ Get API key

CVE-2021-42716

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

7.1 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
None
Availability
High

Exploit likelihood

1.46%Up 0.6 points since Oct 22, 2021
90%50%10%1%

What each source reports

NVD Score used 7.1

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.

Record
CVE-2021-42716
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
CVSS 2.0
5.8 MediumAV:N/AC:M/Au:N/C:P/I:N/A:P
Weakness
CWE-120
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-42716
Updated
2026-11-02
EUVDEUVD-2021-29676 No score

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.

Record
EUVD-2021-29676
Updated
2026-11-03
GitHub AdvisoriesGHSA-44mr-92xw-jfrv 9.1

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

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.

Record
GHSA-44mr-92xw-jfrv
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Weakness
CWE-120
Updated
2026-11-02
OSV 7.1

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.

Record
CVE-2021-42716
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-42716 7.1

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.

Record
DEBIAN-CVE-2021-42716
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
Show 8 moreShow less
OSVUBUNTU-CVE-2021-42716 7.1

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.

Record
UBUNTU-CVE-2021-42716
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVMGASA-2021-0549 No score

Updated curaengine packages fix security vulnerability

Buffer overflow vulnerability in function stbi__extend_receive in stb_image.h in stb 2.26 via a crafted JPEG file. (CVE-2021-28021)

An issue was discovered in stb stb_image.h 1.33 through 2.27. The HDR loader parsed truncated end-of-file RLE scanlines as an infinite sequence of zero-length runs. An attacker could potentially have caused denial of service in applications using stb_image by submitting crafted HDR files. (CVE-2021-42715)

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. (CVE-2021-42716)

Record
MGASA-2021-0549
Updated
2026-11-02
OSVMGASA-2022-0074 No score

Updated zxing-cpp packages fix security vulnerability

Buffer overflow vulnerability in function stbi__extend_receive in stb_image.h in stb 2.26 via a crafted JPEG file. (CVE-2021-28021)

An issue was discovered in stb stb_image.h 1.33 through 2.27. The HDR loader parsed truncated end-of-file RLE scanlines as an infinite sequence of zero-length runs. An attacker could potentially have caused denial of service in applications using stb_image by submitting crafted HDR files. (CVE-2021-42715)

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. (CVE-2021-42716)

Record
MGASA-2022-0074
Updated
2026-11-02
OSVopenSUSE-SU-2022:0018-1 No score

Security update for stb

This update for stb fixes the following issues:

  • CVE-2021-42716: fixed buffer overflow in stb_image PNM loader (boo#1191743)
Record
openSUSE-SU-2022:0018-1
Updated
2026-11-02
OSVopenSUSE-SU-2022:0157-1 No score

Security update for zxing-cpp

This update for zxing-cpp fixes the following issues:

  • CVE-2021-28021: Fixed buffer overflow vulnerability in function stbi__extend_receive in stb_image.h via a crafted JPEG file. (bsc#1191743).
  • CVE-2021-42715: Fixed buffer overflow in stb_image PNM loader (bsc#1191942).
  • CVE-2021-42716: Fixed denial of service in stb_image HDR loader when reading crafted HDR files (bsc#1191944).
Record
openSUSE-SU-2022:0157-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:11686-1 No score

libZXing1-1.2.0-2.1 on GA media

These are all security issues fixed in the libZXing1-1.2.0-2.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11686-1
Updated
2026-11-02
OSVSUSE-SU-2022:0157-1 No score

Security update for zxing-cpp

This update for zxing-cpp fixes the following issues:

  • CVE-2021-28021: Fixed buffer overflow vulnerability in function stbi__extend_receive in stb_image.h via a crafted JPEG file. (bsc#1191743).
  • CVE-2021-42715: Fixed buffer overflow in stb_image PNM loader (bsc#1191942).
  • CVE-2021-42716: Fixed denial of service in stb_image HDR loader when reading crafted HDR files (bsc#1191944).
Record
SUSE-SU-2022:0157-1
Updated
2026-11-02
OSVSUSE-SU-2022:0163-1 No score

Security update for zxing-cpp

This update for zxing-cpp fixes the following issues:

  • CVE-2021-28021: Fixed buffer overflow vulnerability in function stbi__extend_receive in stb_image.h via a crafted JPEG file. (bsc#1191743).
  • CVE-2021-42715: Fixed buffer overflow in stb_image PNM loader (bsc#1191942).
  • CVE-2021-42716: Fixed denial of service in stb_image HDR loader when reading crafted HDR files (bsc#1191944).
Record
SUSE-SU-2022:0163-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
libstb
Debian:12
All versions, plus listed versions
0.0~git20220908.8b5f1f3+ds-10.0~git20230129.5736b15+ds-10.0~git20230129.5736b15+ds-1.10.0~git20230129.5736b15+ds-1.1~exp10.0~git20230129.5736b15+ds-1.20.0~git20240715.f7f20f39fe4f+ds-10.0~git20241109.5c20573+ds-10.0~git20250907.fede005+ds-1
None known
libstb
Debian:13
before 0.0~git20230129.5736b15+ds-1
0.0~git20230129.5736b15+ds-1
libstb
Debian:14
before 0.0~git20230129.5736b15+ds-1
0.0~git20230129.5736b15+ds-1
curaengine
Mageia:8
From an advisory covering 3 CVEs
before 4.8.0-1.1.mga8
4.8.0-1.1.mga8
zxing-cpp
Mageia:8
From an advisory covering 3 CVEs
before 1.1.1-2.1.mga8
1.1.1-2.1.mga8
zxing-cpp
SUSE:Linux Enterprise Module for Package Hub 15 SP3
From an advisory covering 3 CVEs
before 1.2.0-9.7.1
1.2.0-9.7.1
zxing-cpp
SUSE:Linux Enterprise Workstation Extension 15 SP3
From an advisory covering 3 CVEs
before 1.2.0-9.7.1
1.2.0-9.7.1
zxing-cpp
SUSE:Linux Enterprise Software Development Kit 12 SP5
From an advisory covering 3 CVEs
before 1.2.0-8.6.1
1.2.0-8.6.1
zxing-cpp
SUSE:Linux Enterprise Workstation Extension 12 SP5
From an advisory covering 3 CVEs
before 1.2.0-8.6.1
1.2.0-8.6.1
libstb
Ubuntu:20.04:LTS
All versions, plus listed versions
0.0~git20190817.1.052dce1-1
None known
Show 8 moreShow less
Affected packages
PackageAffectedFixed
libstb
Ubuntu:22.04:LTS
All versions, plus listed versions
0.0~git20200713.b42009b+ds-10.0~git20210910.af1a5bc+ds-1
None known
libstb
Ubuntu:24.04:LTS
All versions, plus listed versions
0.0~git20230129.5736b15+ds-10.0~git20230129.5736b15+ds-1.10.0~git20230129.5736b15+ds-1.2
None known
libstb
Ubuntu:25.10
All versions, plus listed versions
0.0~git20240715.f7f20f39fe4f+ds-10.0~git20241109.5c20573+ds-1
None known
libstb
Ubuntu:26.10
All versions, plus listed versions
0.0~git20250907.fede005+ds-1
None known
libstb
Ubuntu:26.04:LTS
All versions, plus listed versions
0.0~git20241109.5c20573+ds-10.0~git20250907.fede005+ds-1
None known
stb
SUSE:Package Hub 15 SP3
before 2.32.1549563867.59e9702-bp153.2.3.1
2.32.1549563867.59e9702-bp153.2.3.1
stb
openSUSE:Leap 15.3
before 2.32.1549563867.59e9702-bp153.2.3.1
2.32.1549563867.59e9702-bp153.2.3.1
zxing-cpp
openSUSE:Leap 15.3
From an advisory covering 3 CVEs
before 1.2.0-9.7.1
1.2.0-9.7.1

History

History
RecordedChangedSources
affected, facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-42716 is a high vulnerability (CVSS 7.1) in Fedoraproject Fedora, published October 21, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.46%, the 73rd percentile. Fixed in libstb 0.0~git20230129.5736b15+ds-1.

References

Show 35 moreShow less
MoveEnter Open