← Back to CVE Explorer

CVE-2026-40492

Full vulnerability record from the local CVENow database.

Description

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.

Severity
CRITICAL
CVSS score
9.8 (v3.1)
Vulnerability status
Deferred
Source identifier
Published
2026-04-18 03:16:13.300000
Last modified
2026-10-26 21:10:00.170000
View original CVE JSON
{
  "id": "CVE-2026-40492",
  "sourceIdentifier": "[email protected]",
  "published": "2026-04-18T03:16:13.300",
  "lastModified": "2026-10-26T21:10:00.170",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "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."
    },
    {
      "lang": "es",
      "value": "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."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "HappySeaFox",
          "product": "sail",
          "versions": [
            {
              "version": "< 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
          "baseScore": 9.8,
          "baseSeverity": "CRITICAL",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "NONE",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 3.9,
        "impactScore": 5.9
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-04-20T15:24:38.837811Z",
          "id": "CVE-2026-40492",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "yes"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-787"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/HappySeaFox/sail/commit/36aa5c7ec8a2bb35f6fb867a1177a6f141156b02",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/HappySeaFox/sail/security/advisories/GHSA-526v-vm72-4v64",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/HappySeaFox/sail/security/advisories/GHSA-526v-vm72-4v64",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
    }
  ]
}