CVE-2026-13705
Received Received - Intake

Heap Out-of-Bounds Read in Imager Perl Library

Vulnerability report for CVE-2026-13705, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-06

Last updated on: 2026-07-06

Assigner: CPANSec

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-06
Last Modified
2026-07-06
Generated
2026-07-06
AI Q&A
2026-07-06
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
tonycoz imager From 0.05 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-125 The product reads data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a heap out-of-bounds read in the Imager Perl module versions before 1.032, specifically in the bundled Imager::File::SGI reader. It occurs in the function read_rgb_16_rle when processing SGI image files that use 16-bit RLE literal runs.

The issue arises because the code checks if the literal run count exceeds the remaining data using a pixel count, but each 16-bit sample actually consumes two bytes. This incorrect check allows the function to read beyond the allocated buffer when a crafted SGI image is processed.

As a result, reading a specially crafted SGI image triggers an over-read before the parser rejects the malformed image, which can cause the process to crash.

Impact Analysis

This vulnerability can lead to a process crash when a crafted SGI image is read by the vulnerable Imager module. The heap out-of-bounds read may cause instability or denial of service in applications that use this module to process SGI images.

Detection Guidance

This vulnerability occurs when processing crafted SGI image files using Imager versions before 1.032 for Perl, specifically in the read_rgb_16_rle function. Detection involves identifying attempts to load or process SGI image files that may trigger the heap out-of-bounds read.

Since the vulnerability is triggered by reading malformed SGI images, one way to detect it is to monitor for crashes or abnormal terminations of processes using Imager to read SGI files.

There are no specific commands provided in the resources to detect this vulnerability directly on a network or system.

Mitigation Strategies

The immediate mitigation step is to update the Imager Perl module to a version that includes the patch fixing this vulnerability.

The patch fixes the buffer read overflow by properly checking the bounds in the read_rgb_16_rle function, ensuring that the literal run count does not exceed half of the remaining data.

Updating to the fixed version of the SGI module (incremented from 0.05 to 0.06) or Imager version 1.032 or later will prevent exploitation.

Additionally, avoid processing untrusted or malformed SGI image files until the update is applied.

Compliance Impact

The provided information does not specify any direct impact of this vulnerability on compliance with common standards and regulations such as GDPR or HIPAA.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-13705. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart