{"id":"GHSA-m298-fh5c-jc66","aliases":["BIT-phpmailer-2020-36326","BIT-wordpress-2020-36326","BIT-wordpress-multisite-2020-36326","CVE-2020-36326"],"title":"Object injection in PHPMailer/PHPMailer","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"CRITICAL","description":"### Impact\nThis is a reintroduction of an earlier issue (CVE-2018-19296) by an unrelated bug fix in PHPMailer 6.1.8.  An external file may be unexpectedly executable if it is used as a path to an attachment file via PHP's support for `.phar` files. Exploitation requires that an attacker is able to provide an unfiltered path to a file to attach, or to trick calling code into generating one. See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info.\n\n### Patches\nThis issue was patched in the PHPMailer 6.4.1 release. This release also implements stricter filtering for attachment paths; paths that look like *any* kind of URL are rejected.\n\n### Workarounds\nValidate paths to loaded files using the same pattern as used in [`isPermittedPath()`](https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php#L1815) before using them in *any* PHP file function, such as `file_exists`. This method can't be used directly because it is protected, but you can implement the same thing in calling code. Note that this should be applied to *all* user-supplied paths passed into such functions; it's not a problem specific to PHPMailer.\n\n### Credit\nThis issue was found by [Fariskhi Vidyan](https://github.com/farisv), reported and managed via Tidelift.","severity":"critical","score":9.8,"published":"2021-05-04T17:42:13.000Z","modified":"2026-07-21T14:00:32.800Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Packagist","name":"phpmailer/phpmailer","sources":[{"name":"OSV · GHSA-m298-fh5c-jc66","url":"https://osv.dev/vulnerability/GHSA-m298-fh5c-jc66"}],"ranges":[{"events":[{"introduced":"6.1.8"},{"fixed":"6.4.1"}],"type":"ECOSYSTEM"}],"versions":["v6.1.8","v6.2.0","v6.3.0","v6.4.0"],"fixed":["6.4.1"]}],"sourceAffected":[],"references":["https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-m298-fh5c-jc66","https://nvd.nist.gov/vuln/detail/CVE-2020-36326","https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9","https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2020-36326.yaml","https://github.com/PHPMailer/PHPMailer","https://github.com/PHPMailer/PHPMailer/releases/tag/v6.4.1","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT"],"sources":[{"name":"OSV","id":"GHSA-m298-fh5c-jc66","modified":"2026-07-21T14:00:32.800777724Z","url":"https://osv.dev/vulnerability/GHSA-m298-fh5c-jc66"}],"assessments":[{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8}],"products":[],"remediation":[],"kev":{"status":"not-listed","checkedAt":"2026-10-28T17:10:31.931Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[]}