Description
Integer overflow in GD Graphics Library libgd 2.0.28 (libgd2), and possibly other versions, allows remote attackers to cause a denial of service and possibly execute arbitrary code via PNG image files with large image rows values that lead to a heap-based buffer overflow in the gdImageCreateFromPngCtx function, a different set of vulnerabilities than CVE-2004-0941.
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 ↗Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 3 | gd +2 | 1.8.4-12.3.1 | RHSA-2004:638 |
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
- GD Graphics Library - Local Heap Overflow EDB-600 · local · Oct 26, 2004 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 5
- RHSA-2004:638 Red Hat Security Advisory: gd security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- DSA-589-1 libgd - integer overflows Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-602-1 libgd2 - integer overlow Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-601-1 libgd1 - integer overflow Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-591-1 libgd2 - integer overflows Debian Security (DSA / DLA) · Mar 9, 2026
References
- P-071 third-party-advisory government-resource
- 23783 third-party-advisory
- 11190 vdb-entry
- 21050 third-party-advisory
- 11523 vdb-entry
- gd-png-bo(17866) vdb-entry
- RHSA-2004:638 vendor-advisory
- DSA-602 vendor-advisory
- MDKSA-2006:113 vendor-advisory
- oval:org.mitre.oval:def:1260 vdb-entry signature
- SUSE-SR:2006:003 vendor-advisory
- 2004-0058 vendor-advisory
- https://issues.rpath.com/browse/RPL-939
- DSA-589 vendor-advisory
- MDKSA-2006:114 vendor-advisory
- DSA-601 vendor-advisory
- MDKSA-2004:132 vendor-advisory
- 18717 third-party-advisory
- MDKSA-2006:122 vendor-advisory
- USN-25-1 vendor-advisory
- oval:org.mitre.oval:def:9952 vdb-entry signature
- 20041026 libgd integer overflow mailing-list
- USN-11-1 vendor-advisory
- 20824 third-party-advisory
- DSA-591 vendor-advisory
- 20866 third-party-advisory