CVE-2021-3603
PHP vulnerability analysis and mitigation

Overview

PHPMailer versions 6.4.1 and earlier contain a vulnerability (CVE-2021-3603) that could result in untrusted code being called if such code is injected into the host project's scope by other means. The vulnerability was discovered in the validateAddress() function where if the $patternselect parameter is set to 'php' (the default value defined by static::$validator), and the global namespace contains a function called 'php', it would be called in preference to the built-in validator of the same name (PHPMailer GitHub, Ubuntu Security).

Technical details

The vulnerability exists in the validateAddress() function's handling of callables. When a string-based callable matches the name of a built-in validator ('php', 'pcre', 'pcre8', 'html5'), the system would incorrectly prioritize the global namespace function over the built-in validator. This issue was patched in PHPMailer 6.5.0 by denying the use of simple strings as validator function names (PHPMailer GitHub).

Impact

If exploited, this vulnerability could allow an attacker to execute arbitrary code through the injection of malicious functions into the global namespace that match the names of built-in validators (Fedora Update).

Exploitability

The vulnerability requires the attacker to first inject code into the host project's scope. The exploit specifically targets the validateAddress() function when using the default 'php' validator pattern (PHPMailer GitHub).

Mitigation and workarounds

The vulnerability was patched in PHPMailer 6.5.0. The fix includes denying the use of simple strings as validator function names. Users who need to inject their own validator should provide a closure instead of a function name. Organizations should upgrade to PHPMailer version 6.5.0 or later to address this security issue (PHPMailer GitHub).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-52777CRITICAL9.4
  • PHP logoPHP
  • yeswiki/yeswiki
NoYesSep 05, 2026
CVE-2026-52775HIGH8.8
  • PHP logoPHP
  • yeswiki/yeswiki
NoYesSep 05, 2026
CVE-2026-52774MEDIUM6.1
  • PHP logoPHP
  • yeswiki/yeswiki
NoYesSep 05, 2026
CVE-2026-52773MEDIUM6.1
  • PHP logoPHP
  • yeswiki/yeswiki
NoYesSep 05, 2026
CVE-2026-52772MEDIUM5.5
  • PHP logoPHP
  • yeswiki/yeswiki
NoYesSep 05, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management