Description
Integer overflow in the ReadSGIImage function in sgi.c in ImageMagick before 6.2.9 allows user-assisted attackers to cause a denial of service (crash) and possibly execute arbitrary code via large (1) bytes_per_pixel, (2) columns, and (3) rows values, which trigger a heap-based buffer overflow.
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 | graphicsmagick | 1.1.7-7 | — |
| Debian 14 | imagemagick | 7:6.2.4.5.dfsg1-0.10 | — |
| Debian 13 | graphicsmagick | 1.1.7-7 | — |
| Debian 13 | imagemagick | 7:6.2.4.5.dfsg1-0.10 | — |
| Debian 12 | graphicsmagick | 1.1.7-7 | — |
| Debian 12 | imagemagick | 7:6.2.4.5.dfsg1-0.10 | — |
| Debian 3.1 | imagemagick | 6:6.0.6.2-2.8 | DSA-1213-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 4 | ImageMagick +4 | 6.0.7.1-16 | RHSA-2006:0633 |
| RHEL 3 | ImageMagick +4 | 5.5.6-20 | RHSA-2006:0633 |
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 - '.SGI' Image File Remote Heap Buffer Overflow EDB-28383 · dos · Aug 14, 2006 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 2
- RHSA-2006:0633 Red Hat Security Advisory: ImageMagick security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- DSA-1213-1 imagemagick Debian Security (DSA / DLA) · Mar 9, 2026
References
- 21679 third-party-advisory
- imagemagick-readsgiimage-bo(28372) vdb-entry
- 19507 vdb-entry
- 21671 third-party-advisory
- 21832 third-party-advisory
- http://www.overflow.pl/adv/imsgiheap.txt
- SUSE-SA:2006:050 vendor-advisory
- oval:org.mitre.oval:def:11129 vdb-entry signature
- 20060816 Re: [Overflow.pl] ImageMagick ReadSGIImage() Heap Overflow mailing-list
- https://issues.rpath.com/browse/RPL-605
- MDKSA-2006:155 vendor-advisory
- GLSA-200609-14 vendor-advisory
- 22096 third-party-advisory
- 21621 third-party-advisory
- USN-337-1 vendor-advisory
- RHSA-2006:0633 vendor-advisory
- 21462 third-party-advisory
- 1016699 vdb-entry
- 22998 third-party-advisory
- DSA-1213 vendor-advisory
- 1385 third-party-advisory
- 22036 third-party-advisory
- 20060814 [Overflow.pl] ImageMagick ReadSGIImage() Heap Overflow mailing-list
- 21525 third-party-advisory