HIGH 7.1

CVE-2026-13705: Imager SGI Heap Buffer Over-Read DoS Vulnerability

Imager, a Perl image processing library, contains a memory safety flaw in its SGI image format parser. When processing specially crafted SGI files, the code miscalculates how many bytes to read from memory, causing it to read beyond the allocated buffer. This occurs only with 16-bit color SGI images and happens early enough in parsing that a malicious image can crash any application using Imager to open untrusted image files. The vulnerability requires user interaction (opening a file) but affects both local and remote scenarios where images are processed.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.1 HIGH · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Weaknesses (CWE)
CWE-125
Affected products
0 configuration(s)
Published / Modified
2026-07-06 / 2026-07-06

NVD description (verbatim)

Imager versions before 1.032 for Perl have a heap out-of-bounds read in the bundled Imager::File::SGI reader via a 16-bit RLE literal run in read_rgb_16_rle. read_rgb_16_rle guards each literal run with if (count > data_left), but count is a pixel count while every 16-bit sample consumes two bytes. The copy loop reads inp[0] * 256 + inp[1] and advances two bytes per pixel, so a run with data_left / 2 < count <= data_left passes the guard yet consumes 2 * count bytes and reads past the end of the buffer. The 8-bit path is unaffected because there one pixel is one byte. Reading a crafted SGI image through Imager->read triggers the over-read before the parser rejects the malformed image, which can crash the process.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability resides in the read_rgb_16_rle function, which decompresses 16-bit RLE-encoded SGI image data. The guard check compares a pixel count against remaining bytes (data_left), but fails to account for the fact that each 16-bit pixel consumes two bytes. When a literal run has count values where data_left / 2 < count ≤ data_left, the validation passes but the subsequent copy loop reads 2 * count bytes, overrunning the buffer. The 8-bit variant is unaffected because it uses a 1:1 mapping between pixel count and byte consumption. The out-of-bounds read occurs during initial parsing before format validation can reject the malformed file, making exploitation straightforward.

Business impact

Any application or service that processes SGI images through Imager faces denial-of-service risk. Crash events could disrupt automated image processing pipelines, document conversion services, or graphic design workflows. While the vulnerability does not enable code execution, the high severity reflects both the ease of triggering a crash and the potential for information disclosure through leaked heap memory. Organizations depending on Imager for user-submitted or externally-sourced images should treat this as a near-term operational risk.

Affected systems

Imager versions before 1.032 for Perl are affected. The vulnerability is specific to SGI format handling and the 16-bit RLE code path, so applications must both (1) link Imager and (2) attempt to parse SGI files to be exploitable. Web services, batch processors, and desktop tools using Imager for image manipulation are typical targets.

Exploitability

Exploitation requires only a crafted SGI image file and a user or automated process that triggers Imager->read() on it. No special privileges or network access are needed; a malicious image sent via email, uploaded to a web form, or placed in a shared folder will trigger the crash. The flaw is deterministic and reliable. However, practical impact depends on whether the target actually processes SGI files—a common format in 3D graphics and legacy CAD workflows but less so in general web image processing.

Remediation

Update Imager to version 1.032 or later. Verify the update through your package manager (typically cpan or your distribution's Perl library repository). If immediate patching is not feasible, restrict SGI file processing or implement input validation to reject SGI images from untrusted sources until the patch is deployed.

Patch guidance

Upgrade Imager to 1.032 or later via CPAN using 'cpan Imager' or 'perl -m CPAN -e "install Imager"', or through your operating system's package manager if available. Verify the installed version with 'perl -MImager -e "print $Imager::VERSION"'. Test the patch in a development environment before deploying to production image processing services.

Detection guidance

Monitor for unexpected process crashes in applications using Imager, especially those with verbose logging of file-open operations. If SGI image parsing triggers segmentation faults or heap corruption messages, investigate recent image uploads or file additions. Intrusion detection can flag attempts to upload .sgi files to web forms, though this is only a weak signal without evidence of Imager processing. Review application logs for Imager errors tied to SGI file operations.

Why prioritize this

This vulnerability merits prompt attention because it combines a high CVSS score (7.1), ease of exploitation (no interaction beyond file opening), and reliability of the crash trigger. While not a code-execution flaw, denial-of-service through memory corruption can degrade availability and may leak sensitive heap data. Organizations processing any SGI images—particularly those in 3D, CAD, or graphics-intensive domains—should prioritize patching within 1–2 weeks.

Risk score, explained

CVSS 7.1 (HIGH) reflects the out-of-bounds read severity (CWE-125), high confidentiality impact from potential heap leakage, high availability impact from process crashes, and low barriers to exploitation (local attack vector, no privileges, user interaction only for file opening, which is normal application behavior). The score appropriately reflects that while code execution is not possible, confidentiality and availability harm is probable.

Frequently asked questions

Do all Imager installations need this patch?

Only those that process SGI image files are at risk. If your Perl code or application never opens .sgi files, the vulnerability is not exploitable in your environment. However, patching is still recommended if you use Imager, since the adoption of SGI handling may change over time.

Can this vulnerability be exploited remotely?

It depends on your deployment. If Imager processes images retrieved from the internet or untrusted sources (e.g., a web service that resizes user uploads), then yes, a remote attacker can craft and submit a malicious SGI file. If Imager only processes local, trusted image files, the attack surface is local only.

Will patching break my existing code?

No. Version 1.032 and later are backward compatible. The patch fixes the bounds check without altering the public API or normal image processing behavior.

Is there a workaround if I cannot patch immediately?

Yes. Implement a file-type whitelist and reject all .sgi uploads or processing requests until the patch is deployed. Alternatively, run Imager-dependent services in a sandboxed environment so a crash does not affect the wider system.

This analysis is based on the published CVE description and CVSS assessment. Patch version numbers and release dates should be verified against the official Imager project repository and CPAN advisories. Organizations should test patches in non-production environments before deployment. This vulnerability does not appear on the CISA KEV catalog at the time of writing, but that status may change. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).