CVE-2026-40493: CWE-787: Out-of-bounds Write in HappySeaFox sail
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 Analysis
Technical Summary
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.
CVE-2026-40493: CWE-787: Out-of-bounds Write in HappySeaFox 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
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.
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 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.