Description
Stack consumption vulnerability in the gdImageFillToBorder function in gd.c in the GD Graphics Library (aka libgd) before 2.2.2, as used in PHP before 5.6.28 and 7.x before 7.0.13, allows remote attackers to cause a denial of service (segmentation violation) via a crafted imagefilltoborder call that triggers use of a negative color value.
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+deb8u8 | DSA-3751-1 |
| Debian 8 | php5 | 5.6.28+dfsg-0+deb8u1 | DSA-3732-1 |
| Debian 7 | libgd2 | 2.0.36~rc1~dfsg-6.1+deb7u7 | DLA-758-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libgd2 | 2.1.1-4ubuntu0.16.04.6 | USN-3213-1 |
| Ubuntu 14.04 LTS | libgd2 | 2.1.0-3ubuntu0.6 | USN-3213-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 3 | rh-php70-php +29 | 7.0.27-1.el6 | RHSA-2018:1296 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP2 | gd | 2.1.0-20.1 | SUSE-SU-2016:3211-1 |
| SLES 12 SP2 | php5 | 5.5.14-89.2 | SUSE-SU-2017:0038-1 |
| SLES 12 SP2 | php7 | 7.0.7-28.2 | SUSE-SU-2017:0017-1 |
| SLES 12 SP1 | gd | 2.1.0-20.1 | SUSE-SU-2016:3211-1 |
| SLES 12 SP1 | php5 | 5.5.14-89.2 | SUSE-SU-2017:0038-1 |
| SLES 12 SP1 | php7 | 7.0.7-28.2 | SUSE-SU-2017:0017-1 |
| SLES 12 | php5 | 5.5.14-89.2 | SUSE-SU-2017:0038-1 |
| SLES 12 | php7 | 7.0.7-28.2 | SUSE-SU-2017:0017-1 |
| SLES 11 SP4 | gd | 2.0.36.RC1-52.29.1 | SUSE-SU-2016:3251-1 |
| SLES 11 SP4 | php53 | 5.3.17-94.1 | SUSE-SU-2017:0109-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 12 SP2 | gd | 2.1.0-20.1 | SUSE-SU-2016:3211-1 |
| SLES for SAP 12 SP1 | gd | 2.1.0-20.1 | SUSE-SU-2016:3211-1 |
| SLES for SAP 11 SP4 | gd | 2.0.36.RC1-52.29.1 | SUSE-SU-2016:3251-1 |
| SLES for SAP 11 SP4 | php53 | 5.3.17-94.1 | SUSE-SU-2017:0109-1 |
Advisories 10
- 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-3213-1 libgd2 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- DLA-758-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3732-1 php5 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3751-1 libgd2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2016:3211-1 Security update for gd SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:0038-1 Security update for php5 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:0109-1 Security update for php53 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2016:3251-1 Security update for gd SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:0017-1 Security update for php7 SUSE / openSUSE Security Updates · May 2, 2025
References
- [oss-security] 20161212 CVE assignment for PHP 5.6.28, 5.6.29, 7.0.13, 7.0.14 and 7.1.0 mailing-list
- openSUSE-SU-2016:3228 vendor-advisory
- openSUSE-SU-2017:0081 vendor-advisory
- http://www.php.net/ChangeLog-7.php
- openSUSE-SU-2017:0006 vendor-advisory
- https://github.com/php/php-src/commit/863d37ea66d5c960db08d6f4a2cbd2518f0f80d1
- DSA-3751 vendor-advisory
- 94865 vdb-entry
- RHSA-2018:1296 vendor-advisory
- http://www.php.net/ChangeLog-5.php
- https://bugs.php.net/bug.php?id=72696
- openSUSE-SU-2017:0061 vendor-advisory
- openSUSE-SU-2016:3239 vendor-advisory
- https://github.com/libgd/libgd/issues/215
- https://github.com/libgd/libgd/commit/77f619d48259383628c3ec4654b1ad578e9eb40e