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.
Published: 2026-04-18
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

A deterministic heap buffer overflow is triggered when the SAIL library decodes PSD images in LAB 16‑bit mode. The library calculates bytes‑per‑pixel from the header fields channels × depth, but allocates the pixel buffer according to the resolved pixel format. For LAB mode with three channels at 16 bits per channel, the calculated bpp is six, while the format reserves only five bytes per pixel. Each pixel write overruns the buffer, creating a reliable overflow that can be leveraged to overwrite adjacent heap memory and potentially execute arbitrary code within the process that loads the image.

Affected Systems

The vulnerability exists in the HappySeaFox:sail image processing library, which is used across multiple platforms for loading and saving images, supporting animation, metadata, and ICC profiles. All versions of sail released prior to commit c930284445ea3ff94451ccd7a57c999eca3bc979 are susceptible; later versions contain the fix.

Risk and Exploitability

The CVSS score of 9.8 indicates critical severity, and the absence of an available EPSS score does not diminish the risk, especially when untrusted image files can be supplied to any application that uses sail. Because the overflow occurs deterministically on every row of a malformed PSD, exploitation requires only a crafted PSD document. As the library is widely used in image‑handling components, the attack vector is likely remote via malicious image delivery, and the vulnerability has not yet been listed in CISA’s Known Exploited Vulnerabilities catalog, but its high severity warrants proactive remediation.

Generated by OpenCVE AI on April 18, 2026 at 17:02 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Sail library to a version that incorporates commit c930284445ea3ff94451ccd7a57c999eca3bc979 or later.
  • Ensure that all applications and services that depend on Sail are rebuilt and redeployed with the patched library.
  • Restrict the acceptance of PSD files to trusted sources or process them in a sandboxed environment to contain any potential exploitation.

Generated by OpenCVE AI on April 18, 2026 at 17:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 20 Apr 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Sat, 18 Apr 2026 03:45:00 +0000

Type Values Removed Values Added
First Time appeared Happyseafox
Happyseafox sail
Vendors & Products Happyseafox
Happyseafox sail

Sat, 18 Apr 2026 02:30:00 +0000

Type Values Removed Values Added
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.
Title SAIL has heap buffer overflow in PSD decoder — bpp mismatch in LAB 16-bit mode
Weaknesses CWE-787
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

Happyseafox Sail
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-04-20T16:15:22.120Z

Reserved: 2026-04-13T19:50:42.115Z

Link: CVE-2026-40493

cve-icon Vulnrichment

Updated: 2026-04-20T16:12:09.099Z

cve-icon NVD

Status : Deferred

Published: 2026-04-18T03:16:13.440

Modified: 2026-04-20T18:55:47.120

Link: CVE-2026-40493

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T17:15:05Z

Weaknesses