CVE-2020-36326
JSON

9.8critical

Object injection in PHPMailer/PHPMailer

Severity
9.8critical CVSS:3.1 by NVD
Exploit likelihood
3.18% (higher than 88% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-m298-fh5c-jc66BIT-PHPMAILER-2020-36326BIT-WORDPRESS-2020-36326BIT-WORDPRESS-MULTISITE-2020-36326

Description

PHPMailer 6.1.8 through 6.4.0 allows object injection through Phar Deserialization via addAttachment with a UNC pathname. NOTE: this is similar to CVE-2018-19296, but arose because 6.1.8 fixed a functionality problem in which UNC pathnames were always considered unreadable by PHPMailer, even in safe contexts. As an unintended side effect, this fix eliminated the code that blocked addAttachment exploitation.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
phpmailer/phpmailer (Packagist)from 6.1.8 before 6.4.1GitHub Advisory Database
phpmailer_project phpmailerfrom 6.1.8 up to 6.4.0NVD
wordpress wordpressfrom 3.7 before 3.7.36, from 3.8 before 3.8.36, from 3.9 before 3.9.34, from 4.0 before 4.0.33, from 4.1 before 4.1.33, from 4.2 before 4.2.30, from 4.3 before 4.3.26, from 4.4 before 4.4.25 and 13 moreNVD
phpmailer (Bitnami)from 6.1.8 before 6.4.1Bitnami Vulnerability Database
wordpress (Bitnami)from 3.7.0 before 3.7.36, from 3.8.0 before 3.8.36, from 3.9.0 before 3.9.34, from 4.0.0 before 4.0.33, from 4.1.0 before 4.1.33, from 4.2.0 before 4.2.30, from 4.3.0 before 4.3.26, from 4.4.0 before 4.4.25 and 13 moreBitnami Vulnerability Database
wordpress-multisite (Bitnami)from 3.7.0 before 3.7.36, from 3.8.0 before 3.8.36, from 3.9.0 before 3.9.34, from 4.0.0 before 4.0.33, from 4.1.0 before 4.1.33, from 4.2.0 before 4.2.30, from 4.3.0 before 4.3.26, from 4.4.0 before 4.4.25 and 13 moreBitnami Vulnerability Database

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P
Bitnami Vulnerability Databasecritical rating

Classification

What each source says

CVE List

PHPMailer 6.1.8 through 6.4.0 allows object injection through Phar Deserialization via addAttachment with a UNC pathname. NOTE: this is similar to CVE-2018-19296, but arose because 6.1.8 fixed a functionality problem in which UNC pathnames were always considered unreadable by PHPMailer, even in safe contexts. As an unintended side effect, this fix eliminated the code that blocked addAttachment exploitation.

GitHub Advisory Database
Impact

This 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 for more info.

Patches

This 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.

Workarounds

Validate paths to loaded files using the same pattern as used in isPermittedPath() 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.

Credit

This issue was found by Fariskhi Vidyan, reported and managed via Tidelift.

NVD (es)

PHPMailer versión 6.1.8 hasta la versión 6.4.0 permite la inyección de objetos a través de Phar Deserialization vía addAttachment con un nombre de ruta UNC. NOTA: esto es similar a CVE-2018-19296, pero surgió porque la versión 6.1.8 corrigió un problema de funcionalidad en el que los nombres de ruta UNC siempre se consideraban ilegibles por PHPMailer, incluso en contextos seguros. Como efecto secundario no intencionado, esta corrección eliminó el código que bloqueaba la explotación de addAttachment

References

https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9advisory, patch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT/vendor-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B/vendor-advisory, web
https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-m298-fh5c-jc66web
https://nvd.nist.gov/vuln/detail/CVE-2020-36326advisory, web
https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2020-36326.yamlweb
https://github.com/PHPMailer/PHPMailerpackage
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.4.1web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5Bweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVTweb

Sources

SourceRecordLicence
CVE ListCVE-2020-36326 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-m298-fh5c-jc66 changed 2026-07-21CC-BY-4.0
NVDCVE-2020-36326 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-PHPMAILER-2020-36326 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-WORDPRESS-2020-36326 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-WORDPRESS-MULTISITE-2020-36326 changed 2026-09-08Apache-2.0