CVE-2020-36326
Object injection in PHPMailer/PHPMailer
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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.
- Record
CVE-2020-36326- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-502
- Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2020-36326- Updated
- 2026-11-02
EUVDEUVD-2021-1129 No score
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.
- Record
EUVD-2021-1129- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-m298-fh5c-jc66
9.8
Object injection in PHPMailer/PHPMailer
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.
- Record
GHSA-m298-fh5c-jc66- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502, CWE-641
- Updated
- 2026-11-02
OSV
9.8
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.
- Record
CVE-2020-36326- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2020-36326
9.8
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.
- Record
DEBIAN-CVE-2020-36326- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-m298-fh5c-jc66
9.8
Object injection in PHPMailer/PHPMailer
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.
- Record
GHSA-m298-fh5c-jc66- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502, CWE-641
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2020-36326
9.8
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.
- Record
UBUNTU-CVE-2020-36326- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVBIT-phpmailer-2020-36326 No score
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.
- Record
BIT-phpmailer-2020-36326- Updated
- 2026-11-02
OSVBIT-wordpress-2020-36326 No score
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.
- Record
BIT-wordpress-2020-36326- Updated
- 2026-11-02
OSVBIT-wordpress-multisite-2020-36326 No score
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.
- Record
BIT-wordpress-multisite-2020-36326- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
phpmailer/phpmailerPackagist |
6.1.8 up to 6.4.1 | 6.4.1 |
phpmailerBitnami |
6.1.8 up to 6.4.1 | 6.4.1 |
wordpressBitnami |
3.7.0 up to 3.7.36, 3.8.0 up to 3.8.36, 3.9.0 up to 3.9.34, 4.0.0 up to 4.0.33, 4.1.0 up to 4.1.33, 4.2.0 up to 4.2.30, 4.3.0 up to 4.3.26, 4.4.0 up to 4.4.25, 4.5.0 up to 4.5.24, 4.6.0 up to 4.6.21, 4.7.0 up to 4.7.21, 4.8.0 up to 4.8.17, 4.9.0 up to 4.9.18, 5.0.0 up to 5.0.13, 5.1.0 up to 5.1.10, 5.2.0 up to 5.2.11, 5.3.0 up to 5.3.8, 5.4.0 up to 5.4.6, 5.5.0 up to 5.5.5, 5.6.0 up to 5.6.4, 5.7.0 up to 5.7.2 | 3.7.363.8.363.9.344.0.334.1.334.2.304.3.264.4.254.5.244.6.214.7.214.8.174.9.185.0.135.1.105.2.115.3.85.4.65.5.55.6.45.7.2 |
wordpress-multisiteBitnami |
3.7.0 up to 3.7.36, 3.8.0 up to 3.8.36, 3.9.0 up to 3.9.34, 4.0.0 up to 4.0.33, 4.1.0 up to 4.1.33, 4.2.0 up to 4.2.30, 4.3.0 up to 4.3.26, 4.4.0 up to 4.4.25, 4.5.0 up to 4.5.24, 4.6.0 up to 4.6.21, 4.7.0 up to 4.7.21, 4.8.0 up to 4.8.17, 4.9.0 up to 4.9.18, 5.0.0 up to 5.0.13, 5.1.0 up to 5.1.10, 5.2.0 up to 5.2.11, 5.3.0 up to 5.3.8, 5.4.0 up to 5.4.6, 5.5.0 up to 5.5.5, 5.6.0 up to 5.6.4, 5.7.0 up to 5.7.2 | 3.7.363.8.363.9.344.0.334.1.334.2.304.3.264.4.254.5.244.6.214.7.214.8.174.9.185.0.135.1.105.2.115.3.85.4.65.5.55.6.45.7.2 |
libphp-phpmailerDebian:12 |
before 6.2.0-2 | 6.2.0-2 |
libphp-phpmailerDebian:13 |
before 6.2.0-2 | 6.2.0-2 |
libphp-phpmailerDebian:14 |
before 6.2.0-2 | 6.2.0-2 |
phpmailer/phpmailerPackagist |
6.1.8 up to 6.4.1, plus listed versions v6.1.8v6.2.0v6.3.0v6.4.0 |
6.4.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2020-36326 is a critical vulnerability (CVSS 9.8) in Phpmailer Project Phpmailer, published April 28, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.09%, the 87th percentile. Fixed in phpmailer/phpmailer 6.4.1.
References
github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B
github.com/PHPMailer/PHPMailer/security/advisories/GHSA-m298-fh5c-jc66
nvd.nist.gov/vuln/detail/CVE-2020-36326
github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2020-36326.yaml
Show 8 moreShow less
github.com/PHPMailer/PHPMailer/releases/tag/v6.4.1
lists.fedoraproject.org/archives/list/[email protected]/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B
lists.fedoraproject.org/archives/list/[email protected]/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT
github.com/advisories/GHSA-m298-fh5c-jc66
security-tracker.debian.org/tracker/CVE-2020-36326
github.com/PHPMailer/PHPMailer
ubuntu.com/security/CVE-2020-36326
cve.org/CVERecord?id=CVE-2020-36326