Critical Heap Overflow in SAIL TGA Codec (CVE-2026-40494)
The National Vulnerability Database has disclosed CVE-2026-40494, a critical heap buffer overflow vulnerability in SAIL, a widely used cross-platform image loading and saving library. Rated with a CVSS score of 9.8, this flaw resides in the TGA codec’s RLE decoder within tga.c.
Specifically, the issue stems from an asymmetric bounds check. While the run-packet path correctly clamps repeat counts, the raw-packet path (lines 305-311) lacks this crucial validation. This oversight permits an attacker to write up to 496 bytes of controlled data past the end of a heap buffer, leading to potential arbitrary code execution or denial of service. The vulnerability has been patched in commit 45d44b1f2e8e0d73e80bc1fd5310cb57f4547302.
This is a severe vulnerability. Given SAIL’s role in handling images, any application or system processing untrusted image files via the library is at risk. Defenders must identify where SAIL is deployed in their environment and prioritize patching. Attackers will quickly weaponize this for initial access or privilege escalation, leveraging the image processing chain as an entry point.
What This Means For You
- If your organization utilizes the SAIL library for image processing, you are exposed. Immediately identify all instances of SAIL in your software stack and ensure they are updated to a version containing commit 45d44b1f2e8e0d73e80bc1fd5310cb57f4547302 or later. Prioritize systems that process untrusted image files, as this is a prime target for heap overflow exploitation.
Related ATT&CK Techniques
🛡️ Detection Rules
3 rules · 6 SIEM formats3 detection rules auto-generated for this incident, mapped to MITRE ATT&CK. Sigma YAML is free — export to any SIEM format via the Intel Bot.
SAIL TGA Heap Overflow - TGA Raw Packet Write - CVE-2026-40494
Indicators of Compromise
| ID | Type | Indicator |
|---|---|---|
| CVE-2026-40494 | Buffer Overflow | SAIL library, TGA codec's RLE decoder in `tga.c` |
| CVE-2026-40494 | Memory Corruption | Heap buffer overflow in SAIL library, TGA codec, raw-packet path (line 305-311) |
| CVE-2026-40494 | Vulnerable Component | SAIL library prior to commit 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 |
Source & Attribution
| Source Platform | NVD |
| Channel | National Vulnerability Database |
| Published | April 18, 2026 at 06:16 UTC |
This content was AI-rewritten and enriched by Shimi's Cyber World based on the original source. All intellectual property rights remain with the original author.
Believe this infringes your rights? Submit a takedown request.