AI analysis
The Imager Perl module (versions 0.45_02 through 1.034) contains an out-of-bounds read in tiff_load_ifd(): the code validates an IFD entry only by checking that offset + size stays within the EXIF block, without ever validating the entry's start offset, and integer wraparound (negative int offsets through 1.032, 32-bit size_t wrapping from 1.033, and 32-bit unsigned long wrapping of the IFD start offset, including on 64-bit Windows) allows that check to pass for entries that begin outside the block. The flaw is triggered whenever an application calls Imager->read() on an attacker-supplied image containing a crafted EXIF/TIFF structure. An attacker can cause parsed EXIF tags to contain memory bytes from outside the block (information disclosure) or crash the parsing process (denial of service). Any application or service using an affected Imager version to process untrusted images is affected. There is currently no public proof-of-concept, no known in-the-wild exploitation, and the issue is not listed in CISA KEV.
What to do: Upgrade to Imager 1.035 or later, which fixes the unchecked start-offset validation in tiff_load_ifd. Until patched, avoid passing untrusted image files (especially TIFF/EXIF) to Imager->read(), or restrict/sanitize image uploads upstream. No public PoC or in-the-wild exploitation is known, so immediate patching is lower urgency but still recommended for services processing third-party images.
Affected
| Imager (Perl module) Imager | 0.45_02 up to but not including 1.035 (i.e., 0.45_02 through 1.034; wraparound behavior varies by version and platform as described above) |
Estimated exposure
moderateroughly 10k–100k deployments (estimate; only services that parse attacker-supplied images with Imager are exposed) — No public install counts exist, but Imager is a long-established CPAN imaging library shipped in Linux/BSD package repositories and used in Perl web applications and image pipelines, so an order-of-magnitude estimate of exposed systems is…
Description
Imager versions from 0.45_02 before 1.035 for Perl read outside the EXIF block via unchecked start offsets in tiff_load_ifd. tiff_load_ifd() validates an IFD entry's data by checking that `entry->offset + entry->size` stays within the EXIF block, and never checks the start offset itself. Where that sum is not the real end of the data, the check passes with the entry starting outside the block. Through 1.032 `entry->offset` is a plain int, so on the usual two's-complement implementations an offset with the high bit set converts to negative and the sum can land back inside the block. From 1.033 the field is a size_t and the addition wraps only where size_t is 32 bits. The IFD's own start offset is checked the same way and wraps where unsigned long is 32 bits, which includes 64-bit Windows. Any caller of Imager->read() on an attacker-supplied image may receive EXIF tags holding bytes from outside the block, or crash the process.