CVE-2026-93018: Imager versions before 1.036 for Perl disclose uninitialised heap memory reading a paletted image with pixel indexes past its colour map in i_gpix_p and i_glin_p
Imager versions before 1.036 for Perl disclose uninitialised heap memory reading a paletted image with pixel indexes past its colour map in igpixp and iglinp.
The palette is allocated uninitialised, and only the entries a reader adds count as populated. The TGA reader stores pixel indexes without checking them against the colour map. igpixp() rejects only an index greater than the count, so an index equal to it reads the first unpopulated entry, and getpixel() returns it.
iglinp() skips any index at or beyond the count without writing that pixel to the caller's buffer. The palette-to-RGB conversion reads each row through an uninitialised buffer, so those pixels of the converted image hold prior heap contents.
Reading an attacker-supplied image through Imager->read() and then fetching its pixels or converting it to RGB discloses process heap memory.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Imager (Perl)to a version that resolves this vulnerability.Fixed in 1.036 - Configuration
Apply the Imager 1.036+ logic so i_glin_p() skips any palette index at or beyond the colour-map count (>=), and i_gpix_p() rejects palette indexes that are >= the count (not just >), preventing reads of unpopulated/uninitialized palette entries.
Imager (Perl) i_gpix_p()/i_glin_p() palette index validation = i_glin_p: skip index >= palette_count; i_gpix_p: reject index >= palette_count
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using Imager before 1.036 are exposed if they read attacker-supplied paletted TGA images and subsequently fetch pixels or convert the image to RGB. The disclosure occurs within the application's process, so exposure depends on whether the resulting pixel data can be returned, logged, stored, or otherwise observed by an attacker.
What does an attacker need to provide?
The attacker needs to supply a paletted image with pixel indexes that are outside its populated colour map. The TGA reader stores those indexes without validating them against the colour map.
Are all invalid palette indexes handled the same way?
No. In i_gpix_p(), an index equal to the populated colour-map count can return the first unpopulated palette entry. In i_glin_p(), indexes at or beyond that count leave pixels unwritten in a buffer that is later used during palette-to-RGB conversion, allowing prior heap contents to appear in converted pixels.
What version addresses the issue?
Upgrade Imager to version 1.036 or later. Versions before 1.036 are affected according to the available information.