7.1high
SDL_image has a heap buffer overflow READ via unchecked colormap index in XCF loader
- Severity
- 7.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.27% (higher than 20% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
SDL_image is a library to load images of various formats as SDL surfaces. In do_layer_surface() in src/IMG_xcf.c, pixel index values from decoded XCF tile data are used directly as colormap indices without validating them against the colormap size (cm_num). A crafted .xcf file with a small colormap and out-of-range pixel indices causes heap out-of-bounds reads of up to 762 bytes past the colormap allocation. Both IMAGE_INDEXED code paths are affected (bpp=1 and bpp=2). The leaked heap bytes are written into the output surface pixel data, making them potentially observable in the rendered image. This vulnerability is fixed with commit 996bf12888925932daace576e09c3053410896f8.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| libsdl-org SDL_image | < 996bf12888925932daace576e09c3053410896f8 | CVE List |
| libsdl sdl_image | before 2026-04-02 | NVD |
All scores
| GitHub_M | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:L |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:L |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
SDL_image is a library to load images of various formats as SDL surfaces. In do_layer_surface() in src/IMG_xcf.c, pixel index values from decoded XCF tile data are used directly as colormap indices without validating them against the colormap size (cm_num). A crafted .xcf file with a small colormap and out-of-range pixel indices causes heap out-of-bounds reads of up to 762 bytes past the colormap allocation. Both IMAGE_INDEXED code paths are affected (bpp=1 and bpp=2). The leaked heap bytes are written into the output surface pixel data, making them potentially observable in the rendered image. This vulnerability is fixed with commit 996bf12888925932daace576e09c3053410896f8.
NVD (es)
SDL_image es una biblioteca para cargar imágenes de varios formatos como superficies SDL. En do_layer_surface() en src/IMG_xcf.c, los valores de índice de píxel de los datos de mosaico XCF decodificados se utilizan directamente como índices de mapa de color sin validarlos contra el tamaño del mapa de color (cm_num). Un archivo .xcf manipulado con un mapa de color pequeño e índices de píxel fuera de rango causa lecturas fuera de límites del heap de hasta 762 bytes más allá de la asignación del mapa de color. Ambas rutas de código IMAGE_INDEXED se ven afectadas (bpp=1 y bpp=2). Los bytes del heap filtrados se escriben en los datos de píxeles de la superficie de salida, haciéndolos potencialmente observables en la imagen renderizada. Esta vulnerabilidad se corrige con el commit 996bf12888925932daace576e09c3053410896f8.
References
| https://github.com/libsdl-org/SDL_image/security/advisories/GHSA-gq8w-x74c-h6p7 | patch, vendor-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-35444 changed 2026-04-08 | CVE Terms of Use |
| NVD | CVE-2026-35444 changed 2026-07-24 | Public domain |