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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libstb | 0.0~git20230129.5736b15+ds-1 | — |
| Debian 13 | libstb | 0.0~git20230129.5736b15+ds-1 | — |
| Debian 12 | libstb | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | libstb | No fix yet | — |
| Ubuntu 26.04 LTS | libstb | No fix yet | — |
| Ubuntu 25.10 | libstb | No fix yet | — |
| Ubuntu 24.04 LTS | libstb | No fix yet | — |
| Ubuntu 22.04 LTS | libstb | No fix yet | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | libstb | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP3 | zxing-cpp | 1.2.0-9.7.1 | SUSE-SU-2022:0157-1 |
| SLES 12 SP5 | zxing-cpp | 1.2.0-8.6.1 | SUSE-SU-2022:0163-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE Package Hub 15 SP3 | stb | 2.32.1549563867.59e9702-bp153.2.3.1 | openSUSE-SU-2022:0018-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 15.3 | stb | 2.32.1549563867.59e9702-bp153.2.3.1 | openSUSE-SU-2022:0018-1 |
| openSUSE Leap 15.3 | zxing-cpp | 1.2.0-9.7.1 | openSUSE-SU-2022:0157-1 |
Advisories 4
- SUSE-SU-2022:0157-1 Security update for zxing-cpp SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2022:0163-1 Security update for zxing-cpp SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2022:0018-1 Security update for stb SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2022:0157-1 Security update for zxing-cpp SUSE / openSUSE Security Updates · May 7, 2025
References
- https://github.com/nothings/stb/issues/1166
- https://github.com/nothings/stb/pull/1223
- https://github.com/nothings/stb/issues/1225
- FEDORA-2021-001f25d986 vendor-advisory
- FEDORA-2021-d1446cd1ac vendor-advisory
- FEDORA-2021-f8ba4a690e vendor-advisory
- FEDORA-2021-0511a38484 vendor-advisory
- FEDORA-2021-082bea5b34 vendor-advisory
- FEDORA-2021-3fc69d203c vendor-advisory
- FEDORA-2021-8ea648186c vendor-advisory
- FEDORA-2021-16d848834d vendor-advisory
- FEDORA-2022-832689aa6b vendor-advisory