Skip to main content

Sail CVE-2026-40493

| EUVDEUVD-2026-23646 CRITICAL
Out-of-bounds Write (CWE-787)
2026-04-18 GitHub_M
9.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Craft LAB-mode PSD file
  2. Delivery
    Deliver to SAIL-using application
  3. Exploit
    Trigger PSD decode
  4. Install
    Buffer overflow on pixel write
  5. C2
    Corrupt heap metadata
  6. Execute
    Overwrite code pointer
  7. Impact
    Execute arbitrary code

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires target application to use SAIL library for image processing AND process untrusted PSD files via SAIL's PSD codec. Specifically requires a PSD file with LAB colorspace (colormode field = 9), 3 channels, and 16-bit depth to trigger the allocation mismatch. Default SAIL configurations include PSD codec support, making all installations vulnerable if they handle PSD files. No authentication required (CVSS PR:N) - attacker needs only the ability to supply a PSD file to the target application. No user interaction required (UI:N) if the application auto-processes images (e.g., server-side thumbnail generation, automated document workflows). Exploitation IS limited by deployment context: applications that do not process PSD files, or process only trusted/internal PSD files, or disable SAIL's PSD codec are not exposed despite running vulnerable SAIL versions.

Impact

CVSS 9.8 (Critical) reflects maximum exploitability: network-accessible attack vector, low complexity, no authentication or user interaction required, and complete compromise of confidentiality, integrity, and availability. However, real-world risk depends heavily on deployment context. SAIL is a library - exploitation requires an application that processes untrusted PSD files using the affected SAIL codec. The deterministic nature of the overflow (occurs on every pixel of every row in LAB-mode PSDs) increases exploit reliability but also makes detection straightforward. No EPSS score available to assess actual exploitation likelihood. Not present in CISA KEV, indicating no confirmed active exploitation campaigns. GitHub security advisory confirms the issue but no public POC is referenced. SSVC assessment: exploitation status unknown, likely automatable given deterministic overflow, technical impact is total system compromise if exploited in a privileged service. Priority depends on whether defenders use SAIL in attack-surface-exposed applications (web servers processing user uploads, email attachment parsers, etc.) versus internal tools. The obscurity of LAB-mode PSD files may reduce attacker interest compared to common formats.

Exploit ScenarioDerived

Attacker crafts a malicious PSD file with LAB colorspace (colormode=9), 3 channels, and 16-bit depth. When a victim application using SAIL processes this file (e.g., web service generating thumbnails from user uploads, document converter, image gallery software), the PSD decoder allocates a 5-byte-per-pixel buffer but writes 6 bytes per pixel. The deterministic one-byte overflow on every pixel across every row corrupts heap metadata. Attacker controls overflow content via pixel data, enabling heap manipulation to overwrite function pointers or vtable entries, achieving arbitrary code execution with the privileges of the processing application.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Apr 18, 2026

Heap buffer overflow in SAIL PSD codec allows remote code execution when processing malicious LAB-mode PSD files. Affects all SAIL versions prior to commit c930284 (HappySeaFox/sail). Attackers can achieve arbitrary code execution (CVSS 9.8: AV:N/AC:L/PR:N/UI:N) by triggering a mismatch between computed bytes-per-pixel (6 bytes for 3-channel 16-bit LAB) and allocated buffer size (5 bytes for BPP40_CIE_LAB format). Every pixel write deterministically overflows the heap buffer. EPSS data not available. Not listed in CISA KEV. Patch available via GitHub commit c930284445ea3ff94451ccd7a57c999eca3bc979.

Earlier versions of this analysis (1)
v1 Apr 18, 2026 - 02:41 CVSS 9.8

Heap buffer overflow in SAIL image library PSD codec allows remote unauthenticated attackers to execute arbitrary code via malformed Photoshop files. The vulnerability affects all SAIL versions prior to commit c930284 and triggers automatically when processing LAB color mode PSD files with 16-bit depth - no user interaction required beyond opening the file. CVSS 9.8 (Critical) with network attack vector, though exploitation requires victim to process attacker-supplied PSD file. No active exploitation confirmed (not in CISA KEV), but deterministic triggering and heap corruption primitive suggest high weaponization potential. EPSS data not provided.

RemediationAI

Update SAIL to commit c930284445ea3ff94451ccd7a57c999eca3bc979 or later, available at https://github.com/HappySeaFox/sail/commit/c930284445ea3ff94451ccd7a57c999eca3bc979. The patch corrects the bytes-per-pixel calculation to align with actual allocated buffer sizes for LAB-mode pixel formats. If immediate patching is not feasible, disable PSD format support in SAIL configuration to eliminate the attack surface - this breaks PSD file processing but prevents exploitation. Alternatively, implement strict input validation to reject PSD files with LAB colorspace (check colormode field in PSD header equals 9) before passing to SAIL - this blocks only the vulnerable path while preserving RGB/CMYK PSD support, but requires application-layer changes and understanding of PSD structure. For network-facing services, deploy content-type filtering to reject application/x-photoshop MIME types at ingress - reduces attack surface but may impact legitimate workflows requiring PSD processing. All workarounds have operational trade-offs; vendor patch is the definitive solution.

Affected VersionsENISA

sail < c930284445ea3ff94451ccd7a57c999eca3bc979

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

SAIL (HappySeaFox/sail) is a cross-platform image codec library supporting formats including Adobe PSD with ICC profiles and metadata. The vulnerability (CWE-787: Out-of-bounds Write) occurs in the PSD decoder's pixel buffer allocation logic. The codec calculates bytes-per-pixel as (channels * depth + 7) / 8 from raw PSD header fields, but allocates memory based on an internally-resolved pixel format enum. For LAB colorspace images with 3 channels at 16-bit depth, the calculation yields 6 bytes per pixel, while the BPP40_CIE_LAB format enum allocates only 5 bytes per pixel (40 bits). This one-byte-per-pixel discrepancy causes every pixel write operation to overflow the heap buffer boundary. The overflow is deterministic and occurs on every row during decode, making exploitation reliable. CPE identifies the affected product as cpe:2.3:a:happyseafox:sail:*:*:*:*:*:*:*:*.

Know when Sail gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Primary rating from Vendor (GitHub_M) · only source for this CVE.

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Analysis Updated
Apr 18, 2026 - 03:28 vuln.today
v2 - CVSS changed
CVE Published
Apr 18, 2026 - 01:41 nvd
CRITICAL 9.8

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

SAIL image processing library versions prior to commit c930284 contain a critical remote code execution vulnerability in PSD file handling that allows unauthenticated attackers to execute arbitrary code by submitting malicious LAB-mode PSD images. Organizations using SAIL for image processing, particularly in web applications or automated workflows, face immediate risk of system compromise if user-supplied or untrusted PSD files are processed.

Business Impact: Severe
Compensating Controls

Vendor-released patch: commit c930284445ea3ff94451ccd7a57c999eca3bc979 (HappySeaFox/sail repository). If immediate patching is not possible: disable PSD file processing entirely, implement allowlist-based file type filtering to reject PSD inputs, isolate SAIL-dependent services in sandboxed environments, and restrict network access to systems processing image files.

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Social Media
3
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Related Vulnerabilities in SAIL Image Library Buffer Overflow

View all 3

More in Sail

View all
CVE-2026-27168 HIGH POC
8.8 Feb 21

The SAIL image library contains a heap buffer overflow in its XWD file parser that fails to validate the bytes_per_line

CVE-2026-59959 MEDIUM
4.8 Oct 28

Denial of service in SAIL 1.0.1 and earlier: the built-in WebP decoder performs a divide-by-zero during loader initializ

CVE-2025-53510 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the PSD Image Decoding functionality of the SAIL Image Decoding Library v0.9

CVE-2025-53085 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the PSD RLE Decoding functionality of the SAIL Image Decoding Library v0.9.8

CVE-2025-52930 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the BMPv3 RLE Decoding functionality of the SAIL Image Decoding Library v0.9

CVE-2025-52456 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the WebP Image Decoding functionality of the SAIL Image Decoding Library v0.

CVE-2025-50129 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the PCX Image Decoding functionality of the SAIL Image Decoding Library v0.9

CVE-2025-46407 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the BMPv3 Palette Decoding functionality of the SAIL Image Decoding Library

CVE-2025-35984 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the PCX Image Decoding functionality of the SAIL Image Decoding Library v0.9

CVE-2025-32468 HIGH POC
8.8 Aug 25

A memory corruption vulnerability exists in the BMPv3 Image Decoding functionality of the SAIL Image Decoding Library v0

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy