CVE-2022-28041
Medium · 6.5CVSS
6.5
EPSS
2.1%
Published
Apr 15, 2022
CISA due date
—
Cloudanix analysis
A bug in image handling code lets attackers crash programs by sending a specially made picture file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
Integer overflow in stbi__jpeg_decode_block_prog_dc allows malformed JPEG input to trigger excessive allocation or crash during progressive DC coefficient decoding.
Why it matters to the business
Applications handling untrusted images can be crashed remotely, causing service outages and requiring restarts until patched packages are deployed.
How an attack unfolds
An attacker supplies a crafted JPEG image containing malformed progressive scan data that triggers the integer overflow inside the stb_image decoder used by affected packages.
How to fix it
Upgrade fb55/css-what to commit 2db00ca221922c5b5131d798614aa043f2f6f80e; node-css-what on Ubuntu 16.04 to 2.1.0-1ubuntu0.16.04.1~esm1, on 18.04 to 2.1.0-1+deb10u1build0.18.04.1, on 20.04 to 3.2.1-1ubuntu0.1~esm1, on 22.04 to 5.1.0-2, and on Debian 11 to 4.0.0-3+deb11u1.
How to confirm the fix worked
Confirm the installed package version matches one of the listed fixed versions and test that the application no longer crashes when loading the previously crashing JPEG sample.
Typical attack path
- Craft JPEG with malicious progressive DC data
- Deliver image via web upload, email attachment or network fetch
- Victim process loads the image using the vulnerable decoder
- Integer overflow occurs leading to DoS
How to detect it
Review application logs for crashes during JPEG decoding and monitor for repeated image-processing failures from untrusted sources.
What your security team should do
- Apply the listed package updates immediately given the public exploit availability
- Scan all systems for the affected css-what and stb_image versions
- Add image decoding to sandboxed processes where possible
The record
stb_image.h v2.27 was discovered to contain an integer overflow via the function stbi__jpeg_decode_block_prog_dc. This vulnerability allows attackers to cause a Denial of Service (DoS) via unspecified vectors.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | libstb | 0 | 0.0~git20180212.15.e6afb9c-1+deb10u1 |
| Debian:11 | libstb | 0 | No fix |
| Debian:12 | libstb | 0 | No fix |
| Debian:13 | libstb | 0 | 0.0~git20230129.5736b15+ds-1 |
| Mageia:8 | curaengine | 0 | 4.8.0-1.1.1.mga8 |
| Mageia:9 | blender | 0 | 3.3.16-1.mga9 |
| Mageia:9 | curaengine | 0 | 4.12.1-3.1.mga9 |
| Ubuntu:20.04:LTS | libstb | 0 | No fix |
| Ubuntu:22.04:LTS | libstb | 0 | No fix |
| Ubuntu:24.04:LTS | libstb | 0 | No fix |
| Ubuntu:24.10 | libstb | 0 | No fix |
| Ubuntu:25.04 | libstb | 0 | No fix |
| Ubuntu:25.10 | libstb | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | libstb | 0 | No fix |
Related vulnerabilities
- CVE-2022-28042 stb_image.h v2.27 was discovered to contain an heap-based use-after-free via the function… Also affects libstb
- CVE-2022-27938 stb_image.h (aka the stb image loader) 2.19, as used in libsixel and other products, has… Also affects libstb
- CVE-2021-42715 An issue was discovered in stb stb_image.h 1.33 through 2.27. Also affects libstb
- CVE-2023-47212 A heap-based buffer overflow vulnerability exists in the comment functionality of stb… Also affects libstb
- CVE-2023-43281 Double Free vulnerability in Nothings Stb Image.h v.2.28 allows a remote attacker to… Also affects libstb
- CVE-2023-45664 stb_image is a single file MIT licensed library for processing images. Also affects libstb
- CVE-2023-45676 stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. Also affects libstb
- CVE-2023-45682 stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. Also affects libstb