CVE-2021-3603Inclusion of Functionality from Untrusted Control Sphere in PHPMailer/PHPMailer
PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). 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. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names.
What to do
Fixed builds are available from Debian, Packagist: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | libphp-phpmailer | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | libphp-phpmailer | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | libphp-phpmailer | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | libphp-phpmailer | Fix pending | 6.2.0-2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-3603 |
| Ubuntu 20.04 | libphp-phpmailer | Fix pending | 6.0.6-0.1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-3603 |
| Ubuntu 16.04 | libphp-phpmailer | Fix pending | ||
| Ubuntu 14.04 | libphp-phpmailer | Fix pending | ||
| Debian 14 | libphp-phpmailer | Fixed | 6.6.3-1 | DEBIAN-CVE-2021-3603 |
| Debian 13 | libphp-phpmailer | Fixed | 6.6.3-1 | DEBIAN-CVE-2021-3603 |
| Debian 12 | libphp-phpmailer | Fixed | 6.6.3-1 | DEBIAN-CVE-2021-3603 |
| Packagist library | phpmailer/phpmailer | Fixed | 6.5.0 | GHSA-77mr-wc79-m8j3 |
What the vendor says
As published in the CVE record by @huntrdev, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- PHPMailer: affected: unspecified to before 6.5.0; fixed in
6.5.0
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://www.huntr.dev/bounties/1-PHPMailer/PHPMailer/
- https://github.com/PHPMailer/PHPMailer/commit/45f3c18dc6a2de1cb1bf49b9b249a9ee36a5f7f3
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FJYSOFCUBS67J3TKR74SD3C454N7VTYM/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3YRMWGA4VTMXFB22KICMB7YMFZNFV3EJ/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.