Executive brief
libsixel is a library used to encode and decode images in the SIXEL format, often used for displaying graphics in terminal emulators. A vulnerability exists where processing extremely large images can cause the software to miscalculate memory requirements, leading to a system crash or potential unauthorized data access. This affects applications that use the library to process images from untrusted sources or with very large dimensions.
Technical details
A signed integer overflow exists in the 'sixel_encode_highcolor' function within 'src/tosixel.c'. The vulnerability occurs because the 'sixel_encode' entry point fails to validate upper bounds for image width and height. When 'quality_mode' is set to 'SIXEL_QUALITY_HIGHCOLOR', the library calculates allocation sizes for 'paletted_pixels' and 'normalized_pixels' using plain integer multiplication. If the product of width and height exceeds INT_MAX, the calculation wraps, resulting in a heap allocation that is significantly smaller than required. Subsequent write operations then exceed the buffer boundaries. This issue is reachable via local attack vectors where an attacker can influence the dimensions passed to the encoder. The vulnerability is fixed in version 1.8.7-r2.
Affected products
- saitoha libsixel 1.4.4 to 1.8.7-r1
Timeline
- 2026-05-03: advisory: GitHub Security Advisory published
- 2026-05-14: disclosed: CVE published to NVD
- 2026-05-14: patched: Fix released in version 1.8.7-r2