Remote code injection in PHPMailer - CVE-2016-10045

 

Remote code injection in PHPMailer - CVE-2016-10045

Published: January 3, 2017 / Updated: April 7, 2020


Vulnerability identifier: #VU3119
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-10045
CWE-ID: CWE-94
Exploitation vector: Remote access
Exploit availability: Public exploit is available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists in PHPMailer due to insufficient sanitization of user-supplied input, when Sender property is not set. A remote attacker can use backslashed double quote character (e.g. \”) to pass additional commands to original mail command and execute them with privileges of the current web server user.

Successful exploitation of the vulnerability may result in system compromise.

Note: this vulnerability exists due to incorrect fix for vulnerability SB2016122601 (CVE-2016-10033)



Affected software

PHPMailer
Arch Linux
Fedora
Ubuntu
Piwigo
php-phpmailer (Alpine package)
libphp-phpmailer (Ubuntu package)
php-PHPMailer

How to mitigate CVE-2016-10045

Install the latest version 5.2.21 from vendor's website.

php-phpmailer (Alpine package) - update to 5.2.4-r0
libphp-phpmailer (Ubuntu package) - update to Ubuntu Pro
php-PHPMailer - addressed in versions 5.2.21-1.el6, 5.2.21-1.el7, 5.2.21-1.fc24, 5.2.21-1.fc25, 5.2.22-1.el6, 5.2.22-1.el7, 5.2.22-1.fc24

Links to Public Exploits and PoC-codes

External References

Related Security Bulletins