Description
Imager::File::GIF versions before 1.006 for Perl allow out-of-bounds reads when consolidating GIF images.
With `gif_consolidate => 1`, palette indices from the image are used without checking the colour table's bounds. The i_readgif_low routine reads beyond the heap allocation and copies the bytes into output pixels. The default GIF reader is not affected.
The same code ships bundled in the Imager distribution.
An attacker supplying a crafted GIF can disclose adjacent heap memory through the decoded output and may crash the process.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| — | Imager-File-GIF | < 1.006 | 1.006 |
| — | Imager | < 1.040 | 1.040 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libimager-perl | 1.040+dfsg-1 | — |
| Debian 13 | libimager-perl | No fix yet | — |
| Debian 12 | libimager-perl | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | libimager-perl | No fix yet | — |
| Ubuntu 26.04 LTS | libimager-perl | No fix yet | — |
| Ubuntu 24.04 LTS | libimager-perl | No fix yet | — |
| Ubuntu 22.04 LTS | libimager-perl | No fix yet | — |
| Ubuntu 20.04 LTS | libimager-perl | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | libimager-perl | No fix yet | — |
| Ubuntu 16.04 LTS | libimager-perl | No fix yet | — |
References
- https://github.com/tonycoz/imager/commit/dec96f12b3d8a7fd94e86264953a5e4919dd6036.patch patch
- https://metacpan.org/release/TONYC/Imager-File-GIF-1.006/changes release-notes
- https://metacpan.org/release/TONYC/Imager-1.040/changes release-notes
- https://github.com/tonycoz/imager/security/advisories/GHSA-v4hp-5h6w-9897 vendor-advisory