CVE-2026-40493: 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 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.
AI Analysis
Technical Summary
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.
CVE-2026-40493: 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 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
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 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.