# PHPMailer untrusted code may be run from an overridden address validator

Advisory record · `GHSA-77mr-wc79-m8j3`

- **Identifiers:** `GHSA-77mr-wc79-m8j3` · `BIT-phpmailer-2021-3603` · `CVE-2021-3603` · `PKSA-m8by-bb7v-7qt5`
- **State:** Confirmed
- **Severity:** CVSS 8.1 High
- **Critical:** No
- **Weakness (CWE):** [CWE-74](https://cwe.mitre.org/data/definitions/74.html) · [CWE-829](https://cwe.mitre.org/data/definitions/829.html)
- **Tags:** [Other injection](https://agentprime.io/advisories/tag/injection.md) · [CWE-829](https://agentprime.io/advisories/tag/cwe-829.md)
- **Published:** 22 Jun 2021
- **Updated:** 17 Feb 2024
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 22 Jun 2021, 15:18 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `phpmailer/phpmailer` (Packagist): affected `<6.5.0`; fixed in `6.5.0`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> PHPMailer versions before 6.5.0 are affected. If a function named php is defined in an application, PHPMailer calls it by default when validating email addresses, such as through validateAddress(), instead of the built-in validator. An attacker would first need to inject code into the application, so the impact is limited to providing a trigger path. Upgrade to PHPMailer 6.5.0 or later, which stops accepting simple strings as validator function names.

Written 4 Nov 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 8.1 High, CVSS 3.1: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`, from CNA (@huntrdev)

- **CISA KEV:** Not listed.
- **EPSS:** 0.023, the 83rd percentile, on 10 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 16 Jun 2021, 15:58 UTC: [Published by the maintainers as a GitHub repository advisory](https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-77mr-wc79-m8j3)
- 31 Oct 2026, 14:30 UTC: First seen by agentprime
- 31 Oct 2026, 14:30 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-77mr-wc79-m8j3)

## Sources

- [GitHub Advisory Database: GHSA-77mr-wc79-m8j3](https://github.com/advisories/GHSA-77mr-wc79-m8j3)
- [OSV: GHSA-77mr-wc79-m8j3](https://osv.dev/vulnerability/GHSA-77mr-wc79-m8j3)
- <https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-77mr-wc79-m8j3>
- <https://nvd.nist.gov/vuln/detail/CVE-2021-3603>
- <https://github.com/PHPMailer/PHPMailer/commit/45f3c18dc6a2de1cb1bf49b9b249a9ee36a5f7f3>
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2021-3603.yaml>
- <https://github.com/PHPMailer/PHPMailer>
- <https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.0>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3YRMWGA4VTMXFB22KICMB7YMFZNFV3EJ>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FJYSOFCUBS67J3TKR74SD3C454N7VTYM>
- <https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603>
- <https://www.huntr.dev/bounties/1-PHPMailer/PHPMailer>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-77mr-wc79-m8j3>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-77mr-wc79-m8j3/>. Everything for agents: <https://agentprime.io/llms.txt>.
