CVE-2020-36326 Object injection in PHPMailer/PHPMailer

Critical 9.8 Published Updated

Attacker can achieve code execution via Phar deserialization in PHPMailer when using addAttachment with a UNC pathname.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2020-36326?

CVE-2020-36326 is a critical unsafe deserialization vulnerability in Wordpress Wordpress, published on 28 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-502

Which versions are affected by CVE-2020-36326?

5 open source packages ship an affected version, including wordpress, phpmailer and wordpress-multisite. It affects 2 products.

PackageAffectedFixed in
wordpress BitnamiFrom 3.7.03.7.36, 3.8.36, 3.9.34, 4.0.33, 4.1.33, 4.2.30, 4.3.26, 4.4.25, 4.5.24, 4.6.21, 4.7.21, 4.8.17, 4.9.18, 5.0.13, 5.1.10, 5.2.11, 5.3.8, 5.4.6, 5.5.5, 5.6.4, 5.7.2
phpmailer BitnamiFrom 6.1.86.4.1
wordpress-multisite BitnamiFrom 3.7.03.7.36, 3.8.36, 3.9.34, 4.0.33, 4.1.33, 4.2.30, 4.3.26, 4.4.25, 4.5.24, 4.6.21, 4.7.21, 4.8.17, 4.9.18, 5.0.13, 5.1.10, 5.2.11, 5.3.8, 5.4.6, 5.5.5, 5.6.4, 5.7.2
phpmailer/phpmailer PackagistFrom 6.1.86.4.1
phpmailer/phpmailer PackagistFrom 6.1.86.4.1

Products include Phpmailer Project Phpmailer, Wordpress Wordpress.

How do I fix CVE-2020-36326?

Upgrade wordpress to a fixed version for your release line: 3.7.36, 3.8.36, 3.9.34 or 4.0.33.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2020-36326 being exploited?

There is no known exploitation of CVE-2020-36326 in the wild and no public exploit code.

All Wordpress Wordpress vulnerabilities

Sources

Also known as BIT-phpmailer-2020-36326, BIT-wordpress-2020-36326, BIT-wordpress-multisite-2020-36326, DEBIAN-CVE-2020-36326, GHSA-m298-fh5c-jc66.

Is CVE-2020-36326 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free