Description
The GIF decoding function gdImageCreateFromGifCtx in gd_gif_in.c in the GD Graphics Library (aka libgd), as used in PHP before 5.6.31 and 7.x before 7.1.7, does not zero colorMap arrays before use. A specially crafted GIF image could use the uninitialized tables to read ~700 bytes from the top of the stack, potentially disclosing sensitive information.
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-1 | — |
| Debian 13 | libgd2 | 2.2.5-1 | — |
| Debian 12 | libgd2 | 2.2.5-1 | — |
| Debian 9 | libgd2 | 2.2.4-2+deb9u1 | DSA-3938-1 |
| Debian 8 | libgd2 | 2.1.0-5+deb8u10 | DSA-3938-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+deb7u9 | DLA-1055-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libgd2 | 2.1.1-4ubuntu0.16.04.7 | USN-3389-1 |
| Ubuntu 14.04 LTS | libgd2 | 2.1.0-3ubuntu0.7 | USN-3389-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 7 | php +24 | 5.4.16-43.el7_4.1 | RHSA-2018:0406 |
| RHEL 3 | rh-php70-php +29 | 7.0.27-1.el6 | RHSA-2018:1296 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP5 | gd | 2.1.0-24.17.1 | SUSE-SU-2020:0623-1 |
| SLES 12 SP4 | gd | 2.1.0-24.17.1 | SUSE-SU-2020:0623-1 |
| 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 | php5 | 5.5.14-109.5.1 | SUSE-SU-2017:2317-1 |
| SLES 12 | php7 | 7.0.7-50.9.2 | SUSE-SU-2017:2303-1 |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 11 SP4 | php53 | 5.3.17-112.5.1 | SUSE-SU-2017:2522-1 |
| SLES for SAP 12 SP5 | gd | 2.1.0-24.17.1 | SUSE-SU-2020:0623-1 |
| SLES for SAP 12 SP4 | gd | 2.1.0-24.17.1 | SUSE-SU-2020:0623-1 |
| SLES for SAP 11 SP4 | php53 | 5.3.17-112.5.1 | SUSE-SU-2017:2522-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.7 | php7 | 7.1.7-r0 | — |
| Alpine v3.6 | gd | 2.2.5-r0 | — |
| Alpine v3.5 | gd | 2.2.5-r0 | — |
| Alpine v3.4 | gd | 2.2.5-r0 | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 7 | php +24 | 5.4.16-43.el7_4.1 | ELSA-2018-0406 |
Advisories 11
- RHSA-2018:1296 Red Hat Security Advisory: rh-php70-php security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- RHSA-2018:0406 Red Hat Security Advisory: php security update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- USN-3389-1 libgd2 vulnerability Ubuntu Security Notices (USN) · Apr 22, 2026
- DSA-3938-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1055-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-2017:2303-1 Security update for php7 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2020:0623-1 Security update for gd 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-2017:2317-1 Security update for php5 SUSE / openSUSE Security Updates · May 2, 2025
- ELSA-2018-0406 Moderate: php security update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Mar 7, 2018
References
- https://bugs.php.net/patch-display.php?bug=74435&patch=fix-74435-php-7.0&revision=1497970038
- https://www.tenable.com/security/tns-2017-12
- DSA-3938 vendor-advisory
- RHSA-2018:1296 vendor-advisory
- http://php.net/ChangeLog-5.php
- https://security.netapp.com/advisory/ntap-20180112-0001/
- 99492 vdb-entry
- http://php.net/ChangeLog-7.php
- RHSA-2018:0406 vendor-advisory
- https://bugs.php.net/bug.php?id=74435