Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.1%top 81%

CVE-2026-40492: CWE-787: Out-of-bounds Write in HappySeaFox sail

0
Critical
VulnerabilityCVE-2026-40492cvecve-2026-40492cwe-787
Published: Sat Apr 18 2026 (04/18/2026, 01:39:48 UTC)
Source: CVE Database V5
Vendor/Project: HappySeaFox
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
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

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/25/2026, 02:54:57 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses