Description
gd_gif_in.c in the GD Graphics Library (aka libgd), as used in PHP before 5.6.33, 7.0.x before 7.0.27, 7.1.x before 7.1.13, and 7.2.x before 7.2.1, has an integer signedness error that leads to an infinite loop via a crafted GIF file, as demonstrated by a call to the imagecreatefromgif or imagecreatefromstring PHP function. This is related to GetCode_ and gdImageCreateFromGifCtx.
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.5-4.1 | — |
| Debian 13 | libgd2 | 2.2.5-4.1 | — |
| Debian 12 | libgd2 | 2.2.5-4.1 | — |
| Debian 9 | php7.0 | 7.0.27-0+deb9u1 | DSA-4080-1 |
| Debian 8 | libgd2 | 2.1.0-5+deb8u12 | DLA-1651-1 |
| Debian 8 | php5 | 5.6.33+dfsg-0+deb8u1 | DSA-4081-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 7 | libgd2 | 2.0.36~rc1~dfsg-6.1+deb7u11 | DLA-1248-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | libgd2 | 2.2.5-4ubuntu0.2 | USN-3755-1 |
| Ubuntu 16.04 LTS | libgd2 | 2.1.1-4ubuntu0.16.04.10 | USN-3755-1 |
| Ubuntu 14.04 LTS | libgd2 | 2.1.0-3ubuntu0.10 | USN-3755-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 3 | rh-php70-php +29 | 7.0.27-1.el6 | RHSA-2018:1296 |
| RHEL 3 | rh-php71-php +27 | 7.1.30-1.el7 | RHSA-2019:2519 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP3 | gd | 2.1.0-24.6.1 | SUSE-SU-2018:0260-1 |
| SLES 12 SP3 | php5 | 5.5.14-109.17.1 | SUSE-SU-2018:0216-1 |
| SLES 12 SP3 | php7 | 7.0.7-50.26.1 | SUSE-SU-2018:0308-1 |
| SLES 12 SP2 | gd | 2.1.0-24.6.1 | SUSE-SU-2018:0260-1 |
| SLES 12 SP2 | php5 | 5.5.14-109.17.1 | SUSE-SU-2018:0216-1 |
| SLES 12 SP2 | php7 | 7.0.7-50.26.1 | SUSE-SU-2018:0308-1 |
| SLES 12 | php5 | 5.5.14-109.17.1 | SUSE-SU-2018:0216-1 |
| SLES 12 | php7 | 7.0.7-50.26.1 | SUSE-SU-2018:0308-1 |
| SLES 11 SP4 | gd | 2.0.36.RC1-52.33.5.1 | SUSE-SU-2018:0235-1 |
| SLES 11 SP4 | php53 | 5.3.17-112.20.1 | SUSE-SU-2018:0806-1 |
| SLES 11 SP3 | php53 | 5.3.17-112.20.1 | SUSE-SU-2018:0806-1 |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 12 SP3 | gd | 2.1.0-24.6.1 | SUSE-SU-2018:0260-1 |
| SLES for SAP 12 SP2 | gd | 2.1.0-24.6.1 | SUSE-SU-2018:0260-1 |
| SLES for SAP 11 SP4 | gd | 2.0.36.RC1-52.33.5.1 | SUSE-SU-2018:0235-1 |
| SLES for SAP 11 SP4 | php53 | 5.3.17-112.20.1 | SUSE-SU-2018:0806-1 |
| SUSE Linux Enterprise Point of Sale 11 SP3 | php53 | 5.3.17-112.20.1 | SUSE-SU-2018:0806-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | gd | 2.3.3-1.1 | openSUSE-SU-2024:10777-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | gd | 2.2.5-r2 | — |
| Alpine v3.23 | gd | 2.2.5-r2 | — |
| Alpine v3.22 | gd | 2.2.5-r2 | — |
| Alpine v3.21 | gd | 2.2.5-r2 | — |
| Alpine v3.20 | gd | 2.2.5-r2 | — |
Show 16 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | gd | 2.2.5-r2 | — |
| Alpine v3.18 | gd | 2.2.5-r2 | — |
| Alpine v3.17 | gd | 2.2.5-r2 | — |
| Alpine v3.16 | gd | 2.2.5-r2 | — |
| Alpine v3.15 | gd | 2.2.5-r2 | — |
| Alpine v3.14 | gd | 2.2.5-r2 | — |
| Alpine v3.13 | gd | 2.2.5-r2 | — |
| Alpine v3.12 | gd | 2.2.5-r2 | — |
| Alpine v3.11 | gd | 2.2.5-r2 | — |
| Alpine v3.10 | gd | 2.2.5-r2 | — |
| Alpine v3.9 | gd | 2.2.5-r2 | — |
| Alpine v3.8 | gd | 2.2.5-r2 | — |
| Alpine v3.8 | php5 | 5.6.33-r0 | — |
| Alpine v3.7 | gd | 2.2.5-r2 | — |
| Alpine v3.7 | php5 | 5.6.33-r0 | — |
| Alpine v3.7 | php7 | 7.1.13-r0 | — |
| Alpine v3.6 | gd | 2.2.5-r2 | — |
| Alpine v3.6 | php5 | 5.6.33-r0 | — |
| Alpine v3.6 | php7 | 7.1.13-r0 | — |
| Alpine v3.5 | php5 | 5.6.33-r0 | — |
| Alpine v3.5 | php7 | 7.0.27-r0 | — |
| Alpine v3.4 | php5 | 5.6.33-r0 | — |
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.
GitHub 2 repositories
-
huzhenghui/Test-7-2-0-PHP-CVE-2018-5711 ★ 2 · Feb 1, 2018
-
huzhenghui/Test-7-2-1-PHP-CVE-2018-5711 ★ 1 · Feb 1, 2018
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 14
- RHSA-2019:2519 Red Hat Security Advisory: rh-php71-php security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- RHSA-2018:1296 Red Hat Security Advisory: rh-php70-php security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- USN-3755-1 libgd2 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- DLA-1651-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-4080-1 php7.0 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-4081-1 php5 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1248-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2018:0806-1 Security update for php53 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2018:0235-1 Security update for gd SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2018:0260-1 Security update for gd SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2018:0216-1 Security update for php5 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:10777-1 gd-2.3.3-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2018:0308-1 Security update for php7 SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2024-0990 PHP: Schwachstelle ermöglicht Denial of Service BSI CERT-Bund (WID) · Apr 29, 2024
References
- https://bugs.php.net/bug.php?id=75571
- USN-3755-1 vendor-advisory
- RHSA-2018:1296 vendor-advisory
- http://php.net/ChangeLog-5.php
- [debian-lts-announce] 20190130 [SECURITY] [DLA 1651-1] libgd2 security update mailing-list
- http://php.net/ChangeLog-7.php
- [debian-lts-announce] 20180119 [SECURITY] [DLA 1248-1] libgd2 security update mailing-list
- GLSA-201903-18 vendor-advisory
- RHSA-2019:2519 vendor-advisory
- FEDORA-2020-e795f92d79 vendor-advisory
- https://www.oracle.com/security-alerts/cpuapr2020.html