CVE-2021-42716
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.
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | libstb | Fix pending | UBUNTU-CVE-2021-42716 | |
| Ubuntu 26.04 | libstb | Under investigation | UBUNTU-CVE-2021-42716 | |
| Ubuntu 25.10 | libstb | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-42716 | |
| Ubuntu 24.04 | libstb | Under investigation | UBUNTU-CVE-2021-42716 | |
| Ubuntu 22.04 | libstb | Under investigation | UBUNTU-CVE-2021-42716 | |
| Ubuntu 20.04 | libstb | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-42716 | |
| Debian 14 | libstb | Fixed | 0.0~git20230129.5736b15+ds-1 | DEBIAN-CVE-2021-42716 |
| Debian 13 | libstb | Fixed | 0.0~git20230129.5736b15+ds-1 | DEBIAN-CVE-2021-42716 |
| Debian 12 | libstb | Fix pending | DEBIAN-CVE-2021-42716 | |
| Red Hat Enterprise Linux 8 | cogl | Not affected | ||
| Red Hat Enterprise Linux 8 | cogl-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | cogl-doc | Not affected | ||
| Red Hat Enterprise Linux 7 | cogl | Not affected | ||
| Red Hat Enterprise Linux 7 | cogl-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | cogl-doc | Not affected | ||
| Red Hat Enterprise Linux 7 | compat-libcogl-pango12 | Not affected | ||
| Red Hat Enterprise Linux 7 | compat-libcogl12 | Not affected | ||
| Red Hat Enterprise Linux 6 | clutter | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | clutter-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | clutter-doc | Will not fix Out of support scope |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/nothings/stb/issues/1166
- https://github.com/nothings/stb/pull/1223
- https://github.com/nothings/stb/issues/1225
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/G2M5CRSGPRF7G3YB5CLU4FXW7ANNHAYT/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ID6II3RIKAMVGVMC6ZAQIXXYYDMTVC4N/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BEGXBDEMTFGINETMJENBZ6SCHVEJQJSY/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CI23LXPEV2GCDQTJSKO6CIILBDTI3R42/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FTZXHFZD36BGE5P6JF252NZZLKMGCY4T/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VP2YEXEAJWI76FPM7D7VXHWD3WESQEYC/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3TDGZFLBOP27LZKLH45WQLSNPSPP7S7Z/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AF2CNP4FVC6LDKNOO4WDCGNDYIP3MPK6/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TXX76TJMZBPN3NU542MGN6B7C7QHRFGB/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.