Integer underflow in GD Graphics Library - CVE-2016-10166

 

Integer underflow in GD Graphics Library - CVE-2016-10166

Published: July 19, 2017


Vulnerability identifier: #VU7574
CSH Severity: High
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2016-10166
CWE-ID: CWE-191
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to perform a denial of service (DoS) attack and potentially compromise vulnerable system.

The vulnerability exists due to integer underflow when decrementing the "u" variable in _gdContributionsAlloc() function in gd_interpolation.c. A remote attacker create a specially crafted image file, trigger memory corruption and crash the affected application or execute arbitrary code on the target system.

Affected software

GD Graphics Library
Red Hat Software Collections
PHP
SUSE Linux
Ubuntu
Slackware Linux
Fedora
gd (Alpine package)
php5 (Alpine package)
php7 (Alpine package)
libgd2-xpm (Ubuntu package)
libgd2-noxpm (Ubuntu package)
libgd3 (Ubuntu package)
libwmf

How to mitigate CVE-2016-10166

Update to version 2.2.4.

PHP - addressed in versions 5.6.40, 7.1.26, 7.2.14, 7.3.1
gd (Alpine package) - update to 2.2.4-r0
php5 (Alpine package) - update to 5.6.40-r0
php7 (Alpine package) - update to 7.1.30-r0
libgd2-xpm (Ubuntu package) - update to 2.0.36~rc1~dfsg-6ubuntu2.4
libgd2-noxpm (Ubuntu package) - update to 2.0.36~rc1~dfsg-6ubuntu2.4
libgd3 (Ubuntu package) - addressed in versions 2.1.0-3ubuntu0.6, 2.1.1-4ubuntu0.16.04.6, 2.2.1-1ubuntu3.3
libwmf - addressed in versions 0.2.8.4-50.fc24, 0.2.8.4-50.fc25

External References

Related Security Bulletins