Description
Heap-based buffer overflow in the ReadPNMImage function in pnm.c for ImageMagick 6.2.1 and earlier allows remote attackers to cause a denial of service (application crash) via a PNM file with a small colors value.
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 | imagemagick | 6:6.0.6.2-2.3 | — |
| Debian 13 | imagemagick | 6:6.0.6.2-2.3 | — |
| Debian 12 | imagemagick | 6:6.0.6.2-2.3 | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 4 | ImageMagick +4 | 6.0.7.1-11 | RHSA-2005:413 |
| RHEL 3 | ImageMagick +4 | 5.5.6-14 | RHSA-2005:413 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- ImageMagick 6.x - '.PNM' Image Decoding Remote Buffer Overflow EDB-25527 · dos · Apr 25, 2005 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- RHSA-2005:413 Red Hat Security Advisory: ImageMagick security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
References
- MDKSA-2005:107 vendor-advisory
- oval:org.mitre.oval:def:10003 vdb-entry signature
- 13351 vdb-entry
- 20050424 [Overflow.pl] ImageMagick ReadPNMImage() Heap Overflow mailing-list
- http://www.overflow.pl/adv/imheapoverflow.txt
- http://www.imagemagick.org/script/changelog.php
- http://bugs.gentoo.org/show_bug.cgi?id=90423
- oval:org.mitre.oval:def:711 vdb-entry signature
- RHSA-2005:413 vendor-advisory