Description
Integer overflow in the _gd2GetHeader function in gd_gd2.c in the GD Graphics Library (aka libgd) before 2.2.3, as used in PHP before 5.5.37, 5.6.x before 5.6.23, and 7.x before 7.0.8, allows remote attackers to cause a denial of service (heap-based buffer overflow and application crash) or possibly have unspecified other impact via crafted chunk dimensions in an image.
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.2.2-29-g3c2b605-1 | — |
| Debian 13 | libgd2 | 2.2.2-29-g3c2b605-1 | — |
| Debian 12 | libgd2 | 2.2.2-29-g3c2b605-1 | — |
| Debian 8 | libgd2 | 2.1.0-5+deb8u4 | DSA-3619-1 |
| Debian 7 | libgd2 | 2.0.36~rc1~dfsg-6.1+deb7u4 | DLA-534-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libgd2 | 2.1.1-4ubuntu0.16.04.2 | USN-3030-1 |
| Ubuntu 14.04 LTS | libgd2 | 2.1.0-3ubuntu0.2 | USN-3030-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 7 | gd +2 | 2.0.35-27.el7_9 | RHSA-2020:5443 |
| RHEL 7 | php +24 | 5.4.16-42.el7 | RHSA-2016:2598 |
| 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 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP3 | php5 | 5.5.14-109.5.1 | SUSE-SU-2017:2317-1 |
| SLES 12 SP3 | php7 | 7.0.7-50.9.2 | SUSE-SU-2017:2303-1 |
| SLES 12 SP2 | php5 | 5.5.14-109.5.1 | SUSE-SU-2017:2317-1 |
| SLES 12 SP2 | php7 | 7.0.7-50.9.2 | SUSE-SU-2017:2303-1 |
| SLES 12 SP1 | php5 | 5.5.14-68.1 | SUSE-SU-2016:1842-1 |
| SLES 12 | php5 | 5.5.14-68.1 | SUSE-SU-2017:2317-1, SUSE-SU-2016:1842-1 |
| SLES 12 | php7 | 7.0.7-50.9.2 | SUSE-SU-2017:2303-1 |
| SLES 11 SP4 | php53 | 5.3.17-74.1 | SUSE-SU-2017:2522-1, SUSE-SU-2016:2013-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 11 SP2 | php5 | 5.2.14-0.7.30.89.1 | SUSE-SU-2016:2080-1 |
| SLES for SAP 11 SP4 | php53 | 5.3.17-74.1 | SUSE-SU-2017:2522-1, SUSE-SU-2016:2013-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | gd | 2.2.3-2.1 | openSUSE-SU-2024:10062-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.4 | gd | 2.2.3-r0 | — |
| Alpine v3.3 | gd | 2.2.1-r2 | — |
| Alpine v3.2 | gd | 2.2.1-r2 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2 | gd +2 | 2.0.35-27.amzn2 | ALAS2-2021-1577 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 7 | gd +2 | 2.0.35-27.el7_9 | ELSA-2020-5443 |
| Oracle Linux 7 | php +24 | 5.4.16-42.el7 | ELSA-2016-2598 |
Advisories 16
- RHSA-2016:2750 Red Hat Security Advisory: rh-php56 security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Aug 5, 2026
- RHSA-2020:5443 Red Hat Security Advisory: gd security update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- RHSA-2016:2598 Red Hat Security Advisory: php security and bug fix update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- USN-3030-1 libgd2 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- DLA-534-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3619-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2017:2522-1 Security update for php53 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2016:1842-1 Security update for php5 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:2303-1 Security update for php7 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:10062-1 gd-2.2.3-2.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:2317-1 Security update for php5 SUSE / openSUSE Security Updates · May 2, 2025
- SUSE-SU-2016:2080-1 Security update for php5 SUSE / openSUSE Security Updates · May 2, 2025
- SUSE-SU-2016:2013-1 Security update for php53 SUSE / openSUSE Security Updates · May 2, 2025
- ALAS2-2021-1577 Moderate: gd security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Jan 7, 2021
- ELSA-2020-5443 Moderate: gd security update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Dec 16, 2020
- ELSA-2016-2598 Moderate: php security and bug fix update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Nov 9, 2016
References
- https://bugs.php.net/bug.php?id=72339
- https://libgd.github.io/release-2.2.3.html
- openSUSE-SU-2016:1761 vendor-advisory
- openSUSE-SU-2016:1922 vendor-advisory
- RHSA-2016:2750 vendor-advisory
- RHSA-2016:2598 vendor-advisory
- http://php.net/ChangeLog-5.php
- http://github.com/php/php-src/commit/7722455726bec8c53458a32851d2a87982cf0eac?w=1
- [oss-security] 20160623 Re: CVE for PHP 5.5.37 issues mailing-list
- GLSA-201612-09 vendor-advisory
- http://php.net/ChangeLog-7.php
- https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05240731
- DSA-3619 vendor-advisory
- SUSE-SU-2016:2013 vendor-advisory
- USN-3030-1 vendor-advisory