CVE-2026-40492: CWE-787: Out-of-bounds Write in HappySeaFox sail
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.
AI Analysis
Technical Summary
The HappySeaFox sail library prior to commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 contains an out-of-bounds write vulnerability (CWE-787) in its XWD codec. The issue arises because the pixel format resolution uses pixmap_depth, but the byte-swap code uses bits_per_pixel independently. When pixmap_depth is 8 (indicating a 1 byte per pixel buffer) but bits_per_pixel is 32, the byte-swap loop accesses memory as uint32_t pointers, causing writes four times larger than the allocated buffer. This leads to memory corruption. The vulnerability is distinct from a previous one (CVE-2026-27168) related to bytes_per_line validation. The referenced commit contains a patch that fixes this flaw.
Potential Impact
This vulnerability allows an attacker to cause out-of-bounds memory writes, potentially leading to arbitrary code execution, denial of service, or data corruption. The CVSS score of 9.8 reflects critical impact on confidentiality, integrity, and availability. There are no known exploits in the wild at this time.
Mitigation Recommendations
A patch fixing this vulnerability is included in commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 of the HappySeaFox sail library. Users should upgrade to this commit or later versions to remediate the issue. Since no official vendor advisory or patch link is provided, verify the patch status with the HappySeaFox project repository or maintainers. No other mitigations are specified.
CVE-2026-40492: CWE-787: Out-of-bounds Write in HappySeaFox sail
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.
CVSS v3.1
Score 9.8critical
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The HappySeaFox sail library prior to commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 contains an out-of-bounds write vulnerability (CWE-787) in its XWD codec. The issue arises because the pixel format resolution uses pixmap_depth, but the byte-swap code uses bits_per_pixel independently. When pixmap_depth is 8 (indicating a 1 byte per pixel buffer) but bits_per_pixel is 32, the byte-swap loop accesses memory as uint32_t pointers, causing writes four times larger than the allocated buffer. This leads to memory corruption. The vulnerability is distinct from a previous one (CVE-2026-27168) related to bytes_per_line validation. The referenced commit contains a patch that fixes this flaw.
Potential Impact
This vulnerability allows an attacker to cause out-of-bounds memory writes, potentially leading to arbitrary code execution, denial of service, or data corruption. The CVSS score of 9.8 reflects critical impact on confidentiality, integrity, and availability. There are no known exploits in the wild at this time.
Mitigation Recommendations
A patch fixing this vulnerability is included in commit 36aa5c7ec8a2bb35f6fb867a1177a6f141156b02 of the HappySeaFox sail library. Users should upgrade to this commit or later versions to remediate the issue. Since no official vendor advisory or patch link is provided, verify the patch status with the HappySeaFox project repository or maintainers. No other mitigations are specified.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-13T19:50:42.115Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69e2ee8ebdfbbecc59cda5d7
Added to database: 4/18/2026, 2:38:06 AM
Last enriched: 4/25/2026, 2:54:57 AM
Last updated: 6/1/2026, 1:01:23 AM
Views: 85
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.