CVEfocus › CVE database › CVE-2021-3603

CVE-2021-3603Inclusion of Functionality from Untrusted Control Sphere in PHPMailer/PHPMailer

CVSS 8.1 HighEPSS 2.3% (higher than 83% of CVEs)Published 2021-06-17Updated 2024-08-03Assigner: @huntrdev

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.

CWE-829

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

4Fixed
4Fix pending
3Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04libphp-phpmailerNot affected
vulnerable_code_not_present
Ubuntu 25.10libphp-phpmailerNot affected
vulnerable_code_not_present
Ubuntu 24.04libphp-phpmailerNot affected
vulnerable_code_not_present
Ubuntu 22.04libphp-phpmailerFix pending6.2.0-2ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2021-3603
Ubuntu 20.04libphp-phpmailerFix pending6.0.6-0.1ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2021-3603
Ubuntu 16.04libphp-phpmailerFix pending
Ubuntu 14.04libphp-phpmailerFix pending
Debian 14libphp-phpmailerFixed6.6.3-1DEBIAN-CVE-2021-3603
Debian 13libphp-phpmailerFixed6.6.3-1DEBIAN-CVE-2021-3603
Debian 12libphp-phpmailerFixed6.6.3-1DEBIAN-CVE-2021-3603
Packagist libraryphpmailer/phpmailerFixed6.5.0GHSA-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.

Vendor advisories:

References

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.