SAIL has heap buffer overflow in TGA RLE decoder — raw packet path missing bounds check
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-787 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| HappySeaFox | sail | before 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 | 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 | Patch available | CNA |
- sail VendorHappySeaFox Affected before 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 Fixed in 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302 Patch available CNA
Remediation
- Fix · CNA sail (HappySeaFox) Fixed in 45d48d1f2e8e0d73e80bc1fd5310cb57f4547302
Timeline
- 2026-10-02 Threatist record created from CVE-2026-40494
References
More HappySeaFox vulnerabilities
- TI-2026-39458 SAIL: Heap out-of-bounds write in SAIL PSD decoder (Bitmap mode ignores depth) CVSS 3.1CRITICAL 9.8
- TI-2026-39457 SAIL: Heap out-of-bounds write in SAIL TGA decoder (indexed-RLE bpp/stride mismatch) CVSS 3.1CRITICAL 9.8
- TI-2026-29244 SAIL has heap buffer overflow in PSD decoder — bpp mismatch in LAB 16-bit mode CVSS 3.1CRITICAL 9.8
- TI-2026-29243 SAIL has heap buffer overflow in XWD decoder — bits_per_pixel vs pixmap_depth type confusion in byte-swap CVSS 3.1CRITICAL 9.8
- TI-2026-39513 SAIL: XBM X10 decoder writes 2 bytes per literal into a 1-byte-per-literal buffer (heap out-of-bounds write) CVSS 3.1HIGH 7.8
- TI-2026-81986 Division by zero in SAIL WebP decoder on malformed animated files CVSS 4.0MEDIUM 4.8
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences