DescriptionStack 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, bugtraq, EDB, Metasploit, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, Mageia, GitHub code/issues, web search, more)
ReferencesDLA-758-1, DSA-3732-1, DSA-3751-1
NVD severitymedium (attack range: remote)
Debian Bugs849038

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
libgd2 (PTS)jessie2.1.0-5+deb8u11fixed
jessie (security)2.1.0-5+deb8u13fixed
stretch (security), stretch2.2.4-2+deb9u4fixed
bullseye, sid, buster2.2.5-5.2fixed
php5 (PTS)jessie5.6.33+dfsg-0+deb8u1fixed
jessie (security)5.6.40+dfsg-0+deb8u4fixed
php7.0 (PTS)stretch (security), stretch7.0.33-0+deb9u3fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs


This problem could be seen as a programmer fault but the fix is easy and
the effect is rather dramatic so it should be fixed anyway. (gd-2.2.2)
Scope of CVE is only the missing "color < 0" test in older versions.
GD release info:
Fixed in PHP 5.6.28, 7.0.13 and 7.1.0
PHP Bug:
Fixed by:
Starting with 5.4.0-1 Debian uses the system copy of libgd

Search for package or bug name: Reporting problems