Code Injection in PHPMailer - CVE-2021-3603
Published: June 16, 2021
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary PHP code on the target system.
The vulnerability exists due to improper input validation. If the $patternselect parameter to validateAddress() is set to 'php' (the default, defined by PHPMailer::$validator), and the global namespace contains a function called php, it will be called in preference to the built-in validator of the same name. A remote attacker can send a specially crafted request and execute arbitrary code on the target system.
Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.
Affected software
Moodle
Kirby
Ubuntu
Fedora
libphp-phpmailer (Ubuntu package)
php-phpmailer6
How to mitigate CVE-2021-3603
Kirby - update to 3.5.7
Moodle - addressed in versions 3.9.13, 3.10.10, 3.11.6
libphp-phpmailer (Ubuntu package) - update to Ubuntu Pro
php-phpmailer6 - addressed in versions 6.5.0-1.fc33, 6.5.0-1.fc34