Description
Integer signedness error in GD Graphics Library 2.1.1 (aka libgd or libgd2) allows remote attackers to cause a denial of service (crash) or potentially execute arbitrary code via crafted compressed gd2 data, which triggers 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 | libgd2 | 2.1.1-4.1 | — |
| Debian 13 | libgd2 | 2.1.1-4.1 | — |
| Debian 12 | libgd2 | 2.1.1-4.1 | — |
| Debian 8 | libgd2 | 2.1.0-5+deb8u1 | DSA-3556-1 |
| Debian 8 | php5 | 5.6.22+dfsg-0+deb8u1 | DSA-3602-1 |
| Debian 7 | libgd2 | 2.0.36~rc1~dfsg-6.1+deb7u2 | DSA-3556-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libgd2 | 2.1.1-4ubuntu0.16.04.1 | USN-2987-1 |
| Ubuntu 14.04 LTS | libgd2 | 2.1.0-3ubuntu0.1 | USN-2987-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 2 | rh-php56 +2 | 2.3-1.el6 | RHSA-2016:2750 |
| RHEL 2 | rh-php56-php +27 | 5.6.25-1.el6 | RHSA-2016:2750 |
| RHEL 2 | rh-php56-php-pear | 1:1.9.5-4.el6 | RHSA-2016:2750 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.4 | gd | 2.2.1-r0 | — |
| Alpine v3.3 | gd | 2.2.1-r2 | — |
| Alpine v3.2 | gd | 2.2.1-r2 | — |
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
- libgd 2.1.1 - Signedness Heap Overflow EDB-39736 · remote · Apr 26, 2016
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 4
- RHSA-2016:2750 Red Hat Security Advisory: rh-php56 security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Aug 5, 2026
- USN-2987-1 libgd2 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- DSA-3556-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3602-1 php5 - security update Debian Security (DSA / DLA) · Mar 9, 2026
References
- DSA-3556 vendor-advisory
- 39736 exploit
- GLSA-201611-22 vendor-advisory
- 87087 vdb-entry
- RHSA-2016:2750 vendor-advisory
- 20160421 CVE-2016-3074: libgd: signedness vulnerability mailing-list
- DSA-3602 vendor-advisory
- FEDORA-2016-0c57b12c7b vendor-advisory
- 1035659 vdb-entry
- GLSA-201607-04 vendor-advisory
- USN-2987-1 vendor-advisory
- SSA:2016-120-02 vendor-advisory
- http://packetstormsecurity.com/files/136757/libgd-2.1.1-Signedness.html
- https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05240731
- 20160421 CVE-2016-3074: libgd: signedness vulnerability mailing-list
- FEDORA-2016-5f91f43826 vendor-advisory
- openSUSE-SU-2016:1274 vendor-advisory
- https://github.com/libgd/libgd/commit/2bb97f407c1145c850416a3bfbcc8cf124e68a19