{"id":"CVE-2021-3603","aliases":["CVE-2021-3603","GHSA-77mr-wc79-m8j3","BIT-PHPMAILER-2021-3603"],"related":[],"kind":"vulnerability","state":"published","title":"Inclusion of Functionality from Untrusted Control Sphere in PHPMailer/PHPMailer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"If a function is defined that has the same name as the default built-in email address validation scheme (`php`), it will be called in default configuration as when no validation scheme is provided, the default scheme's callable `php` was being called. If an attacker is able to inject such a function into the application (a much bigger issue), it will be called whenever an email address is validated, such as when calling `validateAddress()`.\n\n### Impact\nLow impact – exploitation requires that an attacker can already inject code into an application, but it provides a trigger pathway.\n\n### Patches\nThis is patched in PHPMailer 6.5.0 by denying the use of simple strings as validator function names, which is a very minor BC break.\n\n### Workarounds\nInject your own email validator function.\n\n### References\nReported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/).\n[CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the PHPMailer project](https://github.com/PHPMailer/PHPMailer)\n* [Email us](mailto:phpmailer@synchromedia.co.uk).","format":"markdown","source":"ghsa"},{"lang":"es","text":"PHPMailer versión 6.4.1 y anteriores contienen una vulnerabilidad que puede resultar en la llamada de código no confiable (si dicho código es inyectado en el ámbito del proyecto anfitrión por otros medios). Si el parámetro $patternselect de la función validateAddress() es ajustada como \"php\" (el valor predeterminado, definido por PHPMailer::$validator), y el namespace global contiene una función llamada php, ésta será llamada con preferencia al validador incorporado del mismo nombre. Mitigado en PHPMailer versión 6.5.0 negando el uso de cadenas simples como nombres de funciones de validador","source":"nvd"}],"published":"2021-06-17T12:09:42.000Z","modified":"2026-09-08T08:48:24.788Z","severity":{"scorer":"@huntrdev","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"@huntrdev","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-74","CWE-829"],"affected":[{"ranges":[{"type":"custom","introduced":"unspecified","fixed":"6.5.0","status":"affected"}],"vendor":"PHPMailer","product":"PHPMailer","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.5.0"}],"ecosystem":"Packagist","package":"phpmailer/phpmailer","purl":"pkg:composer/phpmailer/phpmailer","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"6.4.1"}],"vendor":"phpmailer_project","product":"phpmailer","cpe":"cpe:2.3:a:phpmailer_project:phpmailer:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"33"},{"status":"affected","version":"34"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.4.2"}],"ecosystem":"Bitnami","package":"phpmailer","purl":"pkg:bitnami/phpmailer","source":"bitnami"}],"references":[{"url":"https://www.huntr.dev/bounties/1-PHPMailer/PHPMailer/","tags":["product","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/PHPMailer/PHPMailer/commit/45f3c18dc6a2de1cb1bf49b9b249a9ee36a5f7f3","tags":["advisory","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FJYSOFCUBS67J3TKR74SD3C454N7VTYM/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3YRMWGA4VTMXFB22KICMB7YMFZNFV3EJ/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-77mr-wc79-m8j3","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-3603","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2021-3603.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/PHPMailer/PHPMailer","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.0","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3YRMWGA4VTMXFB22KICMB7YMFZNFV3EJ","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FJYSOFCUBS67J3TKR74SD3C454N7VTYM","tags":["web"],"sources":["ghsa"]},{"url":"https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603","tags":["web"],"sources":["ghsa"]},{"url":"https://www.huntr.dev/bounties/1-PHPMailer/PHPMailer","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"@huntrdev","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-3603","url":"https://www.cve.org/CVERecord?id=CVE-2021-3603","licence":"CVE Terms of Use","modified":"2024-08-03T17:01:07.074Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-77mr-wc79-m8j3","url":"https://github.com/advisories/GHSA-77mr-wc79-m8j3","licence":"CC-BY-4.0","modified":"2024-02-17T05:42:33.365Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-3603","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-3603","licence":"Public domain","modified":"2026-06-17T04:05:25.257Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-PHPMAILER-2021-3603","url":"https://osv.dev/vulnerability/BIT-PHPMAILER-2021-3603","licence":"Apache-2.0","modified":"2026-09-08T08:48:24.788Z"}],"updatedAt":"2026-11-25T22:58:01.975Z","epss":{"score":0.0226,"percentile":0.835,"date":"2026-12-02T12:00:21.000Z"}}