CVE-2016-5766: Integer Overflow
Fixed bug (Integer Overflow in gd2GetHeader() resulting in heap overflow). (CVE-2016-5766)
Other sources
Integer overflow in the gd2GetHeader function in gdgd2.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.
— MITRE
The gd2GetHeader() is prone to an integer overflow, which result in heap based overflow.
Upstream bug:
https://bugs.php.net/bug.php?id=72339
Upstream patch:
http://git.php.net/?p=php-src.git;a=commitdiff;h=7722455726bec8c53458a32851d2a87982cf0eac
CVE assignment:
http://seclists.org/oss-sec/2016/q2/589
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 7.0.8 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.5.37 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.6.23 - Upgrade
Upgrade
redhat/gdto a version that resolves this vulnerability.Fixed in 2.2.3 - Upgrade
Upgrade
debian/libgd2to a version that resolves this vulnerability.Fixed in 2.2.2-29-g3c2b605-1 - Upgrade
Upgrade
debian/libgd2to a version that resolves this vulnerability.Fixed in 2.0.36~rc1~dfsg-6.1+deb7u4Fixed in 2.1.0-5+deb8u4Fixed in 2.2.2-29-g3c2b605-1 - Upgrade
Upgrade
debian/php5to a version that resolves this vulnerability.Fixed in 5.6.23+dfsg-0+deb8u1Fixed in 5.6.23+dfsg-1 - Upgrade
Upgrade
debian/php7.0to a version that resolves this vulnerability.Fixed in 7.0.8-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.2.3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.5.37 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.6.23 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.0.8
Event History
Frequently Asked Questions
What is the severity of CVE-2016-5766?
CVE-2016-5766 is classified as a high severity vulnerability due to the potential for remote denial of service attacks and application crashes.
How do I fix CVE-2016-5766?
To fix CVE-2016-5766, update the GD Graphics Library to version 2.2.3 or later and ensure PHP is upgraded to 5.5.37, 5.6.23, or 7.0.8 or higher.
What systems are affected by CVE-2016-5766?
CVE-2016-5766 affects versions of the GD Graphics Library prior to 2.2.3 and vulnerable versions of PHP before 5.5.37, 5.6.x before 5.6.23, and 7.x before 7.0.8.
What type of attack can CVE-2016-5766 facilitate?
CVE-2016-5766 can facilitate remote attacks that result in a denial of service through heap-based buffer overflow vulnerabilities.
Is CVE-2016-5766 present in all versions of PHP?
No, CVE-2016-5766 is not present in all versions of PHP; it affects specific versions prior to their respective security patches.