CVE-2021-40656
High · 8.8CVSS
8.8
EPSS
1.0%
Published
Apr 8, 2022
CISA due date
—
Cloudanix analysis
A bug in software that handles certain image files could let attackers take over your computer if you open a specially made image.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Buffer overflow in libsixel/src/quant.c:867 allows memory corruption when processing crafted SIXEL images, enabling arbitrary code execution.
Why it matters to the business
Applications using libsixel for image decoding face risk of remote code execution via malicious images, potentially leading to system compromise; high CVSS and available exploit increase urgency despite low EPSS and no KEV listing.
How an attack unfolds
An attacker crafts a malicious SIXEL image that triggers the buffer overflow in the quantization routine upon processing by a vulnerable libsixel instance, achieving memory corruption and code execution.
How to fix it
Upgrade libsixel to commit fb329124fd4bce693d3fc57447b0b40f62d9f090 or later; for affected Debian iceweasel packages, apply the listed fixed versions such as 2.0.0.10-0etch1.
How to confirm the fix worked
Verify installed libsixel version is at or above the fixed commit; test image processing with known-good and crafted SIXEL samples to confirm absence of overflow.
Typical attack path
- Identify target application or service that processes SIXEL images using vulnerable libsixel
- Craft a malicious SIXEL image exploiting the overflow in quant.c
- Deliver the image to the victim (e.g., via web, email, or file share)
- Victim application parses the image, triggering the buffer overflow
- Achieve code execution and potential persistence or lateral movement
How to detect it
Review application logs for crashes or errors during SIXEL image processing; inspect for unexpected process behavior or memory anomalies around image decoding; correlate with file access to suspicious SIXEL images.
What your security team should do
- Immediately update all instances of libsixel to the fixed commit or patched package versions
- Scan environments for usage of vulnerable libsixel in image-handling workflows
- Monitor for new exploit activity given the available public exploit
- Implement input validation or sandboxing for image processing where upgrades are delayed
The record
libsixel before 1.10 is vulnerable to Buffer Overflow in libsixel/src/quant.c:867.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | libsixel | 0 | No fix |
| Debian:12 | libsixel | 0 | 1.10.3-1 |
| Debian:13 | libsixel | 0 | 1.10.3-1 |
| Ubuntu:16.04:LTS | libsixel | 0 | No fix |
| Ubuntu:18.04:LTS | libsixel | 0 | No fix |
| Ubuntu:20.04:LTS | libsixel | 0 | No fix |
| Ubuntu:22.04:LTS | libsixel | 0 | No fix |
| Ubuntu:24.04:LTS | libsixel | 0 | No fix |
| Ubuntu:24.10 | libsixel | 0 | No fix |
| Ubuntu:25.04 | libsixel | 0 | No fix |
| Ubuntu:25.10 | libsixel | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | libsixel | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | libsixel | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | libsixel | 0 | No fix |
Related vulnerabilities
- CVE-2022-29978 There is a floating point exception error in sixel_encoder_do_resize, encoder.c:633 in… Also affects libsixel
- CVE-2022-29977 There is an assertion failure error in stbi__jpeg_huff_decode, stb_image.h:1894 in… Also affects libsixel
- CVE-2021-41715 libsixel 1.10.0 is vulnerable to Use after free in libsixel/src/dither.c:379. Also affects libsixel
- CVE-2022-27044 libsixel 1.8.6 is affected by Buffer Overflow in libsixel/src/quant.c:876. Also affects libsixel
- CVE-2022-27046 libsixel 1.8.6 suffers from a Heap Use After Free vulnerability in in… Also affects libsixel
- CVE-2021-46700 In libsixel 1.8.6, sixel_encoder_output_without_macro (called from… Also affects libsixel
- CVE-2021-45340 In Libsixel prior to and including v1.10.3, a NULL pointer dereference in the stb_image.h… Also affects libsixel
- CVE-2026-111497 A buffer overflow vulnerability in the Brotli decoder (c/dec/decode.c) in Google Brotli… CWE-787