The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2020-36326

CVE-2020-36326: PHPMailer RCE Vulnerability via Phar

CVE-2020-36326 is a remote code execution flaw in PHPMailer that enables object injection through Phar deserialization via addAttachment with UNC pathnames. This article covers technical details, affected versions, and mitigation.

Published: March 4, 2026

CVE-2020-36326 Overview

CVE-2020-36326 is an insecure deserialization vulnerability affecting PHPMailer versions 6.1.8 through 6.4.0. The vulnerability allows object injection through Phar Deserialization via the addAttachment method when a UNC pathname is supplied. This vulnerability is related to CVE-2018-19296 and emerged as an unintended consequence of a functionality fix in version 6.1.8 that addressed an issue where UNC pathnames were incorrectly treated as unreadable. The fix inadvertently removed security controls that previously blocked exploitation of the addAttachment function.

Critical Impact

Successful exploitation enables remote attackers to achieve arbitrary code execution through PHP object injection, potentially leading to complete system compromise of applications using vulnerable PHPMailer versions.

Affected Products

  • PHPMailer versions 6.1.8 through 6.4.0
  • WordPress (multiple versions bundling vulnerable PHPMailer)
  • Applications and CMS platforms using PHPMailer for email functionality

Discovery Timeline

  • 2021-04-28 - CVE-2020-36326 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2020-36326

Vulnerability Analysis

This object injection vulnerability (CWE-502) exploits PHP's Phar deserialization mechanism through the addAttachment method in PHPMailer. The vulnerability allows attackers to supply a malicious UNC pathname that triggers unsafe deserialization of Phar archive metadata, enabling arbitrary PHP object instantiation. This can lead to remote code execution when combined with existing PHP gadget chains in the application.

The flaw arose from a regression introduced in version 6.1.8. A previous security fix that treated UNC pathnames as unreadable was modified to restore functionality for legitimate use cases. However, this change inadvertently removed the protective code path that prevented attackers from exploiting addAttachment with malicious Phar archives accessed via UNC paths (e.g., \\attacker-server\share\malicious.phar).

Root Cause

The root cause is the removal of security controls during a functionality fix in PHPMailer 6.1.8. The original implementation rejected UNC pathnames entirely, which prevented legitimate use cases but also blocked exploitation. When this restriction was relaxed to allow valid UNC path handling, the code path that would trigger Phar deserialization became accessible to attackers. PHP's stream wrappers automatically deserialize Phar metadata when file operations are performed on phar:// URIs or file paths that PHP interprets as Phar archives.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by supplying a malicious UNC pathname to the addAttachment method. When PHPMailer processes this attachment, PHP's file handling functions may trigger Phar deserialization if the path references a Phar archive on an attacker-controlled SMB share. The deserialization process instantiates objects defined in the Phar's metadata, which can execute arbitrary code through PHP gadget chains present in the application's codebase or included libraries.

The attack typically involves hosting a malicious Phar archive containing a crafted serialized object on a network share, then triggering a vulnerable application to process an attachment path pointing to this archive.

Detection Methods for CVE-2020-36326

Indicators of Compromise

  • Presence of UNC paths (starting with \\) in email attachment parameters or logs
  • Outbound SMB connections (port 445) from web servers to unexpected external hosts
  • Unexpected PHP object instantiation or execution patterns in application logs
  • File access attempts to .phar files from unexpected network locations

Detection Strategies

  • Monitor application logs for UNC path patterns in PHPMailer-related functions
  • Implement network egress filtering to detect and block outbound SMB traffic from web application servers
  • Deploy file integrity monitoring on critical application files to detect signs of code execution
  • Use static analysis tools to identify usage of vulnerable PHPMailer versions in codebases

Monitoring Recommendations

  • Enable verbose logging for PHPMailer operations to capture attachment paths
  • Configure web application firewalls to detect and alert on UNC path injection attempts
  • Monitor for unusual process spawning from PHP/web server processes
  • Audit dependencies regularly to identify outdated PHPMailer installations

How to Mitigate CVE-2020-36326

Immediate Actions Required

  • Upgrade PHPMailer to version 6.4.1 or later immediately
  • Audit all applications using PHPMailer to identify vulnerable versions
  • Implement input validation to reject UNC pathnames in attachment handling
  • Review WordPress installations and update to versions with patched PHPMailer bundles

Patch Information

The PHPMailer project has released a security fix addressing this vulnerability. The patch is available in the PHPMailer GitHub commit. Fedora has also issued package announcements for updated PHPMailer packages.

Workarounds

  • Implement strict input validation to block UNC paths (paths starting with \\ or containing phar:// wrappers) before passing to addAttachment
  • Configure php.ini to disable Phar stream wrapper by setting phar.readonly = 1 if Phar functionality is not required
  • Use network-level controls to block outbound SMB connections from web servers
  • Implement application-level allowlisting for attachment file paths
bash
# PHP configuration to restrict Phar operations
# Add to php.ini or application-specific PHP configuration
phar.readonly = 1

# Disable phar stream wrapper if not needed (requires PHP extension disable)
# Add to disable_functions in php.ini
disable_functions = phar://

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPhpmailer

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability1.12%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-502
  • Technical References
  • Fedora Package Announcement

  • Fedora Package Announcement
  • Vendor Resources
  • GitHub Commit Update
  • Related CVEs
  • CVE-2021-3603: PHPMailer RCE Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English