CVE-2026-40492
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedSAIL 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceIn the SAIL library's XWD codec, a heap buffer overflow occurs due to a mismatch between pixel format resolution and memory access. When `pixmap_depth=8` (1 byte per pixel) but `bits_per_pixel=32`, the byte-swap loop treats the 8-bit buffer as a 32-bit (`uint32_t*`) array, reading/writing 4x beyond the allocated buffer size. This out-of-bounds memory access allows potential arbitrary code execution.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify if SAIL library is installedSearch for SAIL library files (libsail.so, sail.lib, or sail.dll) in the system or application dependencies, or check package managers (e.g., dpkg -l, rpm -qa, or cargo.lock for Rust projects)Affected if SAIL library is present in the environment
-
Determine the installed SAIL versionRun version check command appropriate to the installation method (e.g., sail-config --version for installed binaries, or inspect the source version tag if building from source)Affected if The version cannot be determined or is earlier than the version containing commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02
-
Verify XWD codec support is enabledCheck SAIL build configuration or runtime capabilities for xwd or xwindow_dump codec support (look for --enable-xwd or similar flags, or query the codec list at runtime)Affected if XWD codec support is compiled into SAIL and available for image processing
-
Confirm XWD file processing can occurInspect application code or configuration that handles XWD files (look for xwd extensions in file processing paths, or test by attempting to load a crafted XWD file)Affected if The application processes or can be tricked into processing XWD files with user-supplied or untrusted content
-
Check for untrusted XWD file input sourcesReview file upload handling, image processing pipelines, or any code paths that accept XWD format from external or untrusted sourcesAffected if The environment accepts XWD files from users or untrusted sources without prior validation
If SAIL library with XWD support is installed and processes untrusted XWD files, and the version predates the fix commit, the environment is vulnerable to heap buffer overflow via crafted XWD files with pixmap_depth=8 and bits_per_pixel=32.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade SAIL to version containing commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 or later, which ensures the byte-swap code uses the same pixel format depth as the resolved pixel format rather than an independent bits_per_pixel value.
Commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 or subsequent release
- Obtain the fixed version of SAIL that includes commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02
- If building from source, ensure the XWD codec code includes the fix from commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 which corrects the mismatch between pixmap_depth and bits_per_pixel in the byte-swap logic
- Verify that the fix properly validates or aligns the buffer access based on pixmap_depth rather than using bits_per_pixel independently
- Recompile and test the library to confirm the out-of-bounds write vulnerability is resolved
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation4.0 h
- Testing6.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,808.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-40492 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-40492 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data