SDL_image has a heap buffer overflow READ via unchecked colormap index in XCF loader
Platform
c
Component
sdl_image
Fixed in
2.0.6
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.
How to fix
Actualice a la versión 2.0.6 o superior de SDL_image para mitigar el riesgo de lectura fuera de límites en la memoria. Esta actualización corrige la validación de los índices de la paleta de colores en el cargador XCF, previniendo el acceso a memoria no autorizada.
Monitor your dependencies automatically
Get notified when new vulnerabilities affect your projects. Free forever.
Start free