{"id":"CVE-2026-40492","aliases":["CVE-2026-40492"],"related":[],"kind":"vulnerability","state":"published","title":"SAIL has heap buffer overflow in XWD decoder — bits_per_pixel vs pixmap_depth type confusion in byte-swap","summary":"SAIL is a cross-platform library for loading and saving images with support for animation, metadata, and ICC profiles. Prior to commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02, the XWD codec resolves pixel format based on `pixmap_depth` but the byte-swap code uses `bits_per_pixel` independently. When `pixmap_depth=8` (BPP8_INDEXED, 1 byte/pixel buffer) but `bits_per_pixel=32`, the byte-swap loop accesses memory as `uint32_t*`, reading/writing 4x the allocated buffer size. This is a different vulnerability from the previously reported GHSA-3g38-x2pj-mv55 (CVE-2026-27168), which addressed `bytes_per_line` validation. Commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 contains a patch.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SAIL is a cross-platform library for loading and saving images with support for animation, metadata, and ICC profiles. Prior to commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02, the XWD codec resolves pixel format based on `pixmap_depth` but the byte-swap code uses `bits_per_pixel` independently. When `pixmap_depth=8` (BPP8_INDEXED, 1 byte/pixel buffer) but `bits_per_pixel=32`, the byte-swap loop accesses memory as `uint32_t*`, reading/writing 4x the allocated buffer size. This is a different vulnerability from the previously reported GHSA-3g38-x2pj-mv55 (CVE-2026-27168), which addressed `bytes_per_line` validation. Commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 contains a patch.","source":"cvelist"},{"lang":"es","text":"SAIL es una biblioteca multiplataforma para cargar y guardar imágenes con soporte para animación, metadatos y perfiles ICC. Antes del commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02, el códec XWD resuelve el formato de píxel basándose en pixmap_depth pero el código de intercambio de bytes utiliza bits_per_pixel de forma independiente. Cuando pixmap_depth=8 (BPP8_INDEXED, búfer de 1 byte/píxel) pero bits_per_pixel=32, el bucle de intercambio de bytes accede a la memoria como uint32_t, leyendo/escribiendo 4 veces el tamaño del búfer asignado. Esta es una vulnerabilidad diferente de la previamente reportada GHSA-3g38-x2pj-mv55 (CVE-2026-27168), que abordaba la validación de bytes_per_line. El commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 contiene un parche.","source":"nvd"}],"published":"2026-04-18T01:39:48.056Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"version":"< 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02","status":"affected"}],"vendor":"HappySeaFox","product":"sail","source":"cvelist"}],"references":[{"url":"https://github.com/HappySeaFox/sail/security/advisories/GHSA-526v-vm72-4v64","tags":["exploit","x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/HappySeaFox/sail/commit/36aa5c7ec8a2bb35f6fb867a1177a6f141156b02","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-04-20T15:24:38.837Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40492","url":"https://www.cve.org/CVERecord?id=CVE-2026-40492","licence":"CVE Terms of Use","modified":"2026-04-20T15:24:42.029Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40492","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40492","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.992Z","epss":{"score":0.00419,"percentile":0.3815,"date":"2026-12-01T12:00:22.000Z"}}