#VU54171 Code Injection in PHPMailer


Published: 2021-06-16

Vulnerability identifier: #VU54171

Vulnerability risk: High

CVSSv3.1: 8.5 [CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C]

CVE-ID: CVE-2021-3603

CWE-ID: CWE-94

Exploitation vector: Network

Exploit availability: No

Vulnerable software:
PHPMailer
Web applications / Other software

Vendor: phpmailer.sourceforge.net

Description

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.

Mitigation
Install updates from vendor's website.

Vulnerable software versions

PHPMailer: 2.0.3 - 6.4.1


External links
http://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.0


Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability.


Latest bulletins with this vulnerability