CVE-2016-10033

CRITICAL9.8/ 10.0
Share:
Published: December 30, 2016 at 07:59 PM
Modified: October 22, 2025 at 12:15 AM
Source: cve@mitre.org

Vulnerability Description

The mailSend function in the isMail transport in PHPMailer before 5.2.18 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code via a \" (backslash double quote) in a crafted Sender property.

CVSS Metrics

Base Score
9.8
Severity
CRITICAL
Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weaknesses (CWE)

Source: nvd@nist.gov
Source: 134c704f-9b21-4f2e-91b3-4a467353bcc0

AI Security Analysis

01 // Technical Summary

PHPMailer versions prior to 5.2.18 are vulnerable to a critical remote code execution (RCE) flaw. Attackers can leverage a crafted Sender property containing a backslash-double quote sequence to inject arbitrary commands into the mail command, potentially allowing for complete system compromise and data exfiltration.

02 // Vulnerability Mechanism

Step 1: Payload Delivery: The attacker crafts an email with a malicious Sender property. This property contains a backslash-double quote sequence followed by shell commands (e.g., "; whoami;). Step 2: PHPMailer Processing: The vulnerable PHPMailer code processes the email and attempts to send it using the isMail transport. Step 3: Command Injection: The mailSend function constructs the mail command using the Sender property without proper sanitization. Step 4: Command Execution: The shell interprets the injected commands within the Sender property, executing them on the server. The attacker's commands are executed with the privileges of the web server user. Step 5: System Compromise: The attacker can execute arbitrary commands, potentially leading to data exfiltration, privilege escalation, or complete system takeover.

03 // Deep Technical Analysis

The vulnerability stems from insufficient input validation and sanitization within the mailSend function of the isMail transport in PHPMailer. Specifically, the code fails to properly escape or filter the Sender property before passing it to the mail command. This allows an attacker to inject shell metacharacters, such as backslash-double quotes, to break out of the intended command structure and append malicious commands. The root cause is a lack of proper input validation and command injection protection. The mailSend function directly uses the provided Sender value without adequate sanitization, leading to the execution of attacker-controlled commands. This is a classic example of a command injection vulnerability.

References & Intelligence

http://packetstormsecurity.com/files/140291/PHPMailer-Remote-Code-Execution.html
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/140350/PHPMailer-Sendmail-Argument-Injection.html
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
http://seclists.org/fulldisclosure/2016/Dec/78
Source: cve@mitre.org
Mailing ListPatchThird Party Advisory
http://www.rapid7.com/db/modules/exploit/multi/http/phpmailer_arg_injection
Source: cve@mitre.org
ExploitThird Party Advisory
http://www.securityfocus.com/archive/1/539963/100/0/threaded
Source: cve@mitre.org
Broken LinkThird Party AdvisoryVDB Entry
http://www.securityfocus.com/bid/95108
Source: cve@mitre.org
Broken LinkExploitThird Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1037533
Source: cve@mitre.org
Broken LinkThird Party AdvisoryVDB Entry
https://developer.joomla.org/security-centre/668-20161205-phpmailer-security-advisory.html
Source: cve@mitre.org
Third Party Advisory
https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.18
Source: cve@mitre.org
PatchVendor Advisory
https://github.com/PHPMailer/PHPMailer/wiki/About-the-CVE-2016-10033-and-CVE-2016-10045-vulnerabilities
Source: cve@mitre.org
PatchVendor Advisory
https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html
Source: cve@mitre.org
ExploitPatchThird Party Advisory
https://www.drupal.org/psa-2016-004
Source: cve@mitre.org
Third Party Advisory
https://www.exploit-db.com/exploits/40968/
Source: cve@mitre.org
ExploitPatchThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40969/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40970/
Source: cve@mitre.org
ExploitPatchThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40974/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40986/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/41962/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/41996/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/42024/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/42221/
Source: cve@mitre.org
ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/140291/PHPMailer-Remote-Code-Execution.html
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/140350/PHPMailer-Sendmail-Argument-Injection.html
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
http://seclists.org/fulldisclosure/2016/Dec/78
Source: af854a3a-2127-422b-91ae-364da2661108
Mailing ListPatchThird Party Advisory
http://www.rapid7.com/db/modules/exploit/multi/http/phpmailer_arg_injection
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party Advisory
http://www.securityfocus.com/archive/1/539963/100/0/threaded
Source: af854a3a-2127-422b-91ae-364da2661108
Broken LinkThird Party AdvisoryVDB Entry
http://www.securityfocus.com/bid/95108
Source: af854a3a-2127-422b-91ae-364da2661108
Broken LinkExploitThird Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1037533
Source: af854a3a-2127-422b-91ae-364da2661108
Broken LinkThird Party AdvisoryVDB Entry
https://developer.joomla.org/security-centre/668-20161205-phpmailer-security-advisory.html
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.18
Source: af854a3a-2127-422b-91ae-364da2661108
PatchVendor Advisory
https://github.com/PHPMailer/PHPMailer/wiki/About-the-CVE-2016-10033-and-CVE-2016-10045-vulnerabilities
Source: af854a3a-2127-422b-91ae-364da2661108
PatchVendor Advisory
https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitPatchThird Party Advisory
https://www.drupal.org/psa-2016-004
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://www.exploit-db.com/exploits/40968/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitPatchThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40969/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40970/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitPatchThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40974/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/40986/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/41962/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/41996/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/42024/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.exploit-db.com/exploits/42221/
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitThird Party AdvisoryVDB Entry
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2016-10033
Source: 134c704f-9b21-4f2e-91b3-4a467353bcc0
CVE-2016-10033 - CRITICAL Severity (9.8) | Free CVE Database | 4nuxd