Skip to main content

Perl Imager CVE-2026-102505

| EUVDEUVD-2026-90812 MEDIUM
Incorrect Calculation of Buffer Size (CWE-131)
2026-10-01 CPANSec
6.3
CVSS 3.1 · Vendor: CPANSec
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply crafted paletted image to app
  2. Delivery
    Application requests multi-channel float samples
  3. Exploit
    Undersized buffer allocated in i_gsampf_fp
  4. Execution
    Write past heap buffer end via palette bytes
  5. Impact
    Corrupt adjacent heap, crash or potential code execution

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer size calculation
Exploitation Conditions

Exploitation requires a host application that uses Imager to call getsamples()/i_gsampf_fp with type 'float' AND to request more than one channel from a paletted (palette-type) image, while processing an attacker-supplied image; the malicious palette supplies the overflowing bytes. Limiting factors: the overflow is NOT reached for single-channel float requests, for non-paletted (direct-color) images, or when the application never reads float samples - so the vulnerable path is usage/configuration-dependent rather than universal. The attacker must be able to deliver an image into that specific code path, and the Imager version must be older than 1.037.

Impact

Signals are consistent and point to a genuine but moderate, conditional issue. CVSS 3.1 base is 6.3 (medium) with vector AV:N/AC:L/PR:L/UI:N and partial C/I/A. CISA SSVC reinforces low urgency: Exploitation=none, Automatable=no, Technical Impact=partial. KEV status is NO (not actively exploited) and no public POC/exploit code is referenced - only an advisory, patch commit and changelog. EPSS is not provided in the input, so probabilistic exploitation likelihood cannot be quantified here. The one notable tension is the CVSS PR:L (authenticated) rating: the root cause is an attacker-supplied image whose palette controls the overflowing bytes, which in many deployments needs no authentication to submit - but the actual limiting factor is not authentication at all, it is that the host application must call getsamples()/i_gsampf_fp with type 'float' requesting more than one channel from a paletted image. That application-specific code path, not attacker privilege, is what gates exploitation; verify the real auth requirement against the specific deployment rather than treating PR:L as universal. Net: a real memory-safety bug worth patching, but not an emergency - no confirmed exploitation, not automatable, partial impact, and a non-default/usage-dependent trigger.

Exploit ScenarioDerived

An application built on Imager accepts a user-uploaded image and, somewhere in its pipeline, reads pixel data as floating-point samples requesting more than one channel. An attacker uploads a crafted paletted image whose palette entries are chosen to control the bytes written past the undersized per-pixel buffer, triggering a heap overflow during getsamples() processing. No public exploit code is identified, and successful memory corruption depends on the application exercising the float multi-channel code path.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 01, 2026

Heap buffer overflow in the Perl Imager module before version 1.037 allows memory corruption inside i_gsampf_fp when a host application asks for float samples across more than one channel of an attacker-supplied paletted image, with the image's own palette controlling the bytes written past the end of the allocation. The vulnerable path is conditional rather than universal: it is only reached when an application calls getsamples() with type 'float' on a palette-type image and requests multiple channels, so real-world exposure depends on how the embedding application uses the library. No public exploit code and no confirmed active exploitation were identified at time of analysis, and CISA's SSVC evaluation rates exploitation as 'none' and automatable as 'no'; the vendor CVSS vector indicates low privileges required (PR:L) while our independent assessment treats the vector as unauthenticated with high attack complexity (PR:N/AC:H), so authentication requirements are not consistent across sources.

RemediationAI

Upgrade the Imager Perl module to version 1.037 or later - vendor-released patch: 1.037 - which is the release referenced by the official change log and the fix commit; the exact upstream change is commit aae49c6be065aa467e834105c816359394a634db (patch at https://github.com/tonycoz/imager/commit/aae49c6be065aa467e834105c816359394a634db.patch), which corrects the buffer size calculation in i_gsampf_fp(). If an immediate upgrade is not possible, the most effective compensating control is to avoid the vulnerable call pattern entirely: ensure application code never invokes getsamples() with type 'float' on paletted images while requesting more than one channel - reading a single channel at a time, or requesting integer sample types (8/16-bit) or converting paletted inputs to direct-color before sampling, all stay outside the overflowing path, at the cost of extra sampling calls, possible precision changes, or additional memory for the converted image. Note that the fix commit also removes the dependency on palette-derived data being trusted, so no configuration flag alone fully neutralizes the bug; treat any pipeline that accepts attacker-supplied images into Imager's float sampling code as high priority for upgrade. Additional details are in the vendor advisory at https://github.com/tonycoz/imager/security/advisories/GHSA-4rx6-cgv3-fmxp and the release notes at https://metacpan.org/release/TONYC/Imager-1.037/changes.

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

Imager is a Perl image-manipulation library whose performance-critical image decoding and sampling routines are implemented in C/XS, exposed to Perl through functions such as getsamples(). The affected routine, i_gsampf_fp() in image.c, retrieves pixel sample values as floating-point data. For paletted (indexed-color) images, the function computed its temporary work buffer as 'mymalloc(sizeof(i_sample_t) * (r-l))' - effectively one sample per pixel in the requested row range - but then wrote one sample for every requested channel of each pixel. This mismatch is a classic CWE-131 (Incorrect Calculation of Buffer Size): the allocation assumes channel count of one, while the write loop iterates over chan_count, producing a heap overflow. The upstream fix (commit aae49c6be065aa467e834105c816359394a634db) changes the allocation to 'sizeof(i_sample_t) * (r-l) * chan_count', restoring the correct size relationship. Because the overflowing values come from the image's palette entries, an attacker crafting the image gains direct influence over the out-of-bounds data, which is why the assessed impact includes low confidentiality, integrity, and availability effects rather than a guaranteed control-flow hijack. The overflow is not triggered for single-channel float requests, for direct-color (non-paletted) images, or by applications that never read float samples.

Know when Imager 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 (CPANSec) PRIMARY 6.3 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
vuln.today AI 5.6 MEDIUM

Supplying a malicious image needs no privilege (PR:N), but the overflow only triggers when the app requests multi-channel float samples from a paletted image, a specific condition (AC:H); impact is partial heap corruption.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (CPANSec).

CVSS VectorVendor: CPANSec

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

DescriptionCVE.org

Imager versions before 1.037 for Perl overflow a heap buffer fetching float samples from a paletted image in i_gsampf_fp.

For a paletted image, getsamples() with type "float" allocates a buffer of one sample per pixel and fetches every requested channel of each pixel into it. Requesting more than one channel writes past its end.

An attacker-supplied image controls the overflowing bytes through its palette.

Threat Intelligence Overview

EPSS Score
0.2%
Top 86% exploitable
Prevalence
Low
Niche Perl/CPAN imaging module, limited modern production footprint
Data Quality
6 sources
Confidence: High

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
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· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
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.

Affected Products (CPE)CVE.org

cpe:2.3:a:tonycoz:imager:*:*:*:*:*:perl:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy