Skip to main content

Sail EUVDEUVD-2026-23648

| CVE-2026-40494 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
    Deliver malicious TGA file
  2. Delivery
    Application invokes SAIL TGA decoder
  3. Exploit
    Parser allocates undersized heap buffer
  4. Install
    RLE raw-packet handler writes 496 bytes past buffer
  5. C2
    Overwrite heap metadata/function pointers
  6. Execute
    Redirect execution to attacker payload
  7. Impact
    Execute arbitrary code in application context

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

Exploitation requires the target application to invoke SAIL's TGA decoding functionality on attacker-supplied file data. Vulnerable code path is triggered when processing TGA files with RLE compression (image type 9, 10, or 11 in TGA header) containing raw-packet sequences. No user interaction required if the application automatically processes uploaded files (CVSS UI:N). No authentication required for network-accessible upload endpoints (CVSS PR:N). Vulnerability affects default SAIL builds with TGA codec enabled-no special compilation flags or non-default configuration needed. Exploitation is limited to scenarios where untrusted TGA files reach the decoder; applications that restrict image processing to trusted sources or validated formats (JPEG/PNG only) are not exposed despite using vulnerable SAIL versions. Attack succeeds against both little-endian and big-endian platforms as TGA format parsing is endian-aware.

Impact

CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) reflects accurate real-world risk for applications parsing untrusted TGA files from network sources-web servers processing user uploads, email attachment handlers, or document conversion services. Attack complexity is genuinely low: crafting malformed RLE packets requires only basic understanding of TGA format specification. No EPSS score provided, but exploitation likelihood is high given: (1) complete technical disclosure in GitHub advisory with exact vulnerable lines, (2) deterministic 496-byte overrun simplifies exploit development compared to variable-length overflows, (3) heap corruption with attacker-controlled data enables reliable code execution on modern platforms via heap spray or metadata overwrite techniques. Absence from CISA KEV and no identified POC suggests targeted rather than mass exploitation to date. SSVC decision factors: exploitation status unproven, technical impact total (RCE), automatable via malicious file hosting. Priority depends on deployment context-critical for internet-facing image processors, lower for sandboxed desktop applications with user confirmation dialogs. Key uncertainty: prevalence of SAIL library in production environments not documented in available references.

Exploit ScenarioDerived

Attacker hosts a specially crafted TGA file on a web server or embeds it in a document. When a victim application using SAIL processes this file (via user upload to a web application, email attachment preview, or automated document conversion pipeline), the TGA decoder allocates a heap buffer based on image dimensions. The malicious file contains RLE raw-packet sequences designed to write 496 bytes past this buffer, overwriting adjacent heap metadata or function pointers. Attacker gains arbitrary code execution in the context of the processing application, potentially escalating to full system compromise if the service runs with elevated privileges.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 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 image library's TGA decoder allows remote code execution via malformed RLE-compressed TGA files against all versions prior to commit 45d48d1. Network-accessible applications processing untrusted TGA images can be fully compromised without authentication or user interaction (CVSS 9.8). The raw-packet RLE decompression path permits writing up to 496 bytes of attacker-controlled data beyond allocated heap bounds. Vendor patch confirmed via GitHub commit 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302. No CISA KEV listing or public POC identified at time of analysis, but the straightforward exploitation conditions (parsing untrusted files) and complete technical disclosure create high weaponization risk.

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

Heap buffer overflow in SAIL image library's TGA decoder allows remote code execution via maliciously crafted TGA files. The vulnerability affects the raw-packet path of the RLE decoder in tga.c, which fails to validate buffer boundaries before writing up to 496 bytes of attacker-controlled data. CVSS 9.8 (critical) with network attack vector and no authentication required. EPSS data unavailable, not listed in CISA KEV. Upstream fix available in commit 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302, but released patched version not independently confirmed.

RemediationAI

Update SAIL library to commit 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 or any subsequent release incorporating this fix (https://github.com/HappySeaFox/sail/commit/45d48d1f2e8e0d73e80bc1fd5310cb57f4547302). Rebuild all dependent applications against patched library version. For environments unable to immediately upgrade, implement defense-in-depth controls: disable TGA format support entirely if not business-critical (eliminates attack surface), enforce strict file type validation before passing to SAIL (reject files with TGA magic bytes 0x00 at offset 0-1), deploy image processing in isolated sandboxes with limited heap executable memory (containers, seccomp filters, or pledged processes reduce RCE impact to denial-of-service). Note that disabling TGA support breaks legitimate TGA file workflows; file type filtering can be bypassed via polyglot files; sandboxing adds operational complexity and may degrade performance for batch processing. Workarounds are interim mitigations only-vendor patch remains the complete remediation.

Affected VersionsENISA

sail < 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302

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 (cpe:2.3:a:happyseafox:sail) is a cross-platform image codec library supporting format conversion, animation, metadata, and ICC profiles. The vulnerability resides in the TGA (Targa) format codec's run-length encoding (RLE) decompression routine in tga.c. TGA RLE uses two packet types: run-length packets (repeating pixel data) and raw packets (literal pixel data). The decoder correctly bounds-checks run-length packets at line 297 by clamping repeat counts to remaining buffer space, but the raw-packet handler (lines 305-311) lacks equivalent validation. This asymmetric validation creates a classic CWE-787 out-of-bounds write condition where raw-packet sequences can write attacker-controlled pixel data up to 496 bytes past the heap allocation boundary. The 496-byte overrun limit derives from TGA packet structure (maximum 128 pixels per packet × variable bytes-per-pixel), making this a deterministic overflow rather than unbounded corruption.

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

4
Patch released
Apr 20, 2026 - 18:55 nvd
Patch available
Analysis Updated
Apr 18, 2026 - 03:27 vuln.today
v2 - CVSS changed
Patch available
Apr 18, 2026 - 03:01 EUVD
CVE Published
Apr 18, 2026 - 01:42 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 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302, the TGA codec's RLE decoder in tga.c has an asymmetric bounds check vulnerability. The run-packet path (line 297) correctly clamps the repeat count to the remaining buffer space, but the raw-packet path (line 305-311) has no equivalent bounds check. This allows writing up to 496 bytes of attacker-controlled data past the end of a heap buffer. Commit 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 patches the issue.

Executive ViewAI

Why It Matters

SAIL image library versions prior to commit 45d48d1 contain a critical heap buffer overflow in the TGA decoder that enables unauthenticated remote code execution when processing malformed image files. Any organization using SAIL to process untrusted TGA images-including web applications, image processing services, and document management systems-faces immediate risk of full system compromise without requiring user authentication or interaction.

Business Impact: Severe
Compensating Controls

Apply vendor patch. Interim mitigations pending patch deployment: disable TGA file parsing in SAIL-dependent applications; implement network-level file-type filtering to reject TGA uploads; restrict file processing to authenticated, internal users only; run vulnerable services in sandboxed or isolated environments with minimal privileges.

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