CVE-2026-33020: libsixel: Integer Overflow in write_png_to_file() leads to Heap-based Buffer Overflow
libsixel is a SIXEL encoder/decoder implementation derived from kmiya's sixel. Versions 1.8.7 and prior contain an integer overflow which leads to a heap buffer overflow via sixelframeconverttorgb888() in frame.c, where allocation size and pointer offset computations for palettised images (PAL1, PAL2, PAL4) are performed using int arithmetic before casting to sizet. For images whose pixel count exceeds INTMAX / 4, the overflow produces an undersized heap allocation for the conversion buffer and a negative pointer offset for the normalization sub-buffer, after which sixelhelpernormalizepixelformat() writes the full image data starting from the invalid pointer, causing massive heap corruption confirmed by ASAN. An attacker providing a specially crafted large palettised PNG can corrupt the heap of the victim process, resulting in a reliable crash and potential arbitrary code execution. This issue has been fixed in version 1.8.7-r1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
libsixelto a version that resolves this vulnerability.Fixed in 1.8.7-r1
Event History
Frequently Asked Questions
What is the severity of CVE-2026-33020?
CVE-2026-33020 has a high severity due to the potential for remote code execution caused by the heap-based buffer overflow.
How do I fix CVE-2026-33020?
To fix CVE-2026-33020, upgrade to libsixel version 1.8.8 or later.
What causes CVE-2026-33020?
CVE-2026-33020 is caused by an integer overflow in the write_png_to_file() function leading to a heap buffer overflow.
What versions of libsixel are affected by CVE-2026-33020?
All versions of libsixel up to and including 1.8.7 are affected by CVE-2026-33020.
What is the impact of CVE-2026-33020?
The impact of CVE-2026-33020 includes the potential for an attacker to execute arbitrary code on a vulnerable system.