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…

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

0
Critical
VulnerabilityCVE-2026-40493cvecve-2026-40493cwe-787
Published: Sat Apr 18 2026 (04/18/2026, 01:41:14 UTC)
Source: CVE Database V5
Vendor/Project: HappySeaFox
Product: sail

Description

CVE-2026-40493 is a critical out-of-bounds write vulnerability in the HappySeaFox sail library, a cross-platform image loading and saving library. The flaw occurs in the PSD codec when handling LAB mode images with specific channel and depth values, causing a heap buffer overflow due to a mismatch between computed bytes-per-pixel and allocated buffer size. This vulnerability can lead to complete compromise of confidentiality, integrity, and availability. A patch fixing this issue exists in commit c930284445ea3ff94451ccd7a57c999eca3bc979. No known exploits are reported in the wild.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/18/2026, 02:53:12 UTC

Technical Analysis

The vulnerability in HappySeaFox sail affects versions prior to commit c930284445ea3ff94451ccd7a57c999eca3bc979. The PSD codec calculates bytes-per-pixel (bpp) from raw header fields as channels multiplied by depth, but allocates the pixel buffer based on the resolved pixel format. For LAB mode with channels=3 and depth=16, bpp is calculated as 6 bytes per pixel, while the allocated format BPP40_CIE_LAB only reserves 5 bytes per pixel. This discrepancy causes every pixel write to overflow the allocated buffer, resulting in a deterministic heap buffer overflow on each row. The issue is classified as CWE-787 (Out-of-bounds Write) and carries a CVSS 3.1 score of 9.8, indicating critical severity with network attack vector, low attack complexity, no privileges required, no user interaction, and full impact on confidentiality, integrity, and availability. The vulnerability was fixed in the referenced commit.

Potential Impact

Successful exploitation of this vulnerability allows an attacker to perform a heap buffer overflow, potentially leading to arbitrary code execution, denial of service, or data corruption. The CVSS score of 9.8 reflects critical impact across confidentiality, integrity, and availability. There are no known exploits in the wild at this time.

Mitigation Recommendations

A patch addressing this vulnerability is included in commit c930284445ea3ff94451ccd7a57c999eca3bc979. Users of HappySeaFox sail should upgrade to this commit or later versions to remediate the issue. Since this is not a cloud service, remediation depends on applying the patch. Patch status is not explicitly stated beyond the commit reference; users should verify the vendor's repository for the official fix.

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: 69e2ee8ebdfbbecc59cda5db

Added to database: 4/18/2026, 2:38:06 AM

Last enriched: 4/18/2026, 2:53:12 AM

Last updated: 4/18/2026, 4:39:49 AM

Views: 8

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