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-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

SAIL is a cross-platform library for loading and saving images with support for animation, metadata, and ICC profiles. Prior to commit c930284445ea3ff94451ccd7a57c999eca3bc979, the PSD codec computes bytes-per-pixel (`bpp`) from raw header fields `channels * depth`, but the pixel buffer is allocated based on the resolved pixel format. For LAB mode with `channels=3, depth=16`, `bpp = (3*16+7)/8 = 6`, but the format `BPP40_CIE_LAB` allocates only 5 bytes per pixel. Every pixel write overshoots, causing a deterministic heap buffer overflow on every row. Commit c930284445ea3ff94451ccd7a57c999eca3bc979 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/26/2026, 02:40:20 UTC

Technical Analysis

The HappySeaFox sail library prior to commit c930284445ea3ff94451ccd7a57c999eca3bc979 contains an out-of-bounds write vulnerability (CWE-787) in its PSD codec. The issue arises because the bytes-per-pixel (bpp) calculation uses raw header fields (channels * depth), resulting in a bpp of 6 for LAB mode with channels=3 and depth=16. However, the pixel buffer allocation for the BPP40_CIE_LAB format only reserves 5 bytes per pixel. This discrepancy causes every pixel write to exceed the allocated buffer, leading to a deterministic heap buffer overflow on each row. The vulnerability is critical with a CVSS 3.1 score of 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). The issue was fixed in commit c930284445ea3ff94451ccd7a57c999eca3bc979.

Potential Impact

Successful exploitation of this vulnerability can lead to a heap buffer overflow, potentially allowing an attacker to execute arbitrary code, cause a denial of service, or compromise system integrity and confidentiality. The CVSS score of 9.8 reflects the critical nature of the vulnerability with network attack vector, no privileges required, and no user interaction needed.

Mitigation Recommendations

A patch addressing this vulnerability was introduced in commit c930284445ea3ff94451ccd7a57c999eca3bc979. Users of the HappySeaFox sail library should upgrade to this commit or a later version that includes the fix. Since this is not a cloud service, remediation depends on applying the updated library version. Patch status is not explicitly confirmed beyond the commit reference; users should verify the vendor's repository or advisory for the official patched release.

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/26/2026, 2:40:20 AM

Last updated: 6/1/2026, 8:59:56 PM

Views: 95

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