Summary
Dawid Golunski discovered that PHPMailer was not properly escaping user
input data used as arguments to functions executed by the system shell. An
attacker could possibly use this issue to execute arbitrary code. This
issue only affected Ubuntu 16.04 ESM. (CVE-2016-10033, CVE-2016-10045)
It was discovered that PHPMailer was not properly escaping characters
in certain fields of the code_generator.php example code. An attacker
could possibly use this issue to conduct cross-site scripting (XSS)
attacks. This issue was only fixed in Ubuntu 16.04 ESM and Ubuntu 18.04
ESM. (CVE-2017-11503)
Yongxiang Li discovered that PHPMailer was not properly converting
relative paths provided as user input when adding attachments to messages,
which could lead to relative image URLs being treated as absolute local
file paths and added as attachments. An attacker could possibly use this
issue to access unauthorized resources and expose sensitive information.
This issue only affected Ubuntu 16.04 ESM. (CVE-2017-5223)
Sehun Oh discovered that PHPMailer was not properly processing untrusted
non-local file attachments, which could lead to an object injection. An
attacker could possibly use this issue to execute arbitrary code. This
issue only affected Ubuntu 16.04 ESM. (CVE-2018-19296)
Elar Lang discovered that PHPMailer was not properly escaping file
attachment names, which could lead to a misinterpretation of file types
by entities processing the message. An attacker could possibly use this
issue to bypass attachment filters. This issue was only fixed in Ubuntu
16.04 ESM and Ubuntu 20.04 ESM. (CVE-2020-13625)
It was discovered that PHPMailer was not properly handling callables in
its validateAddress function, which could result in untrusted code being
called should the global namespace contain a function called 'php'. An
attacker could possibly use this issue to execute arbitrary code. This
issue was only fixed in Ubuntu 20.04 ESM and Ubuntu 22.04 ESM.
(CVE-2021-3603)
Fixed packages 4
| Release | Package | Fixed in |
|---|---|---|
| Ubuntu · Pro 16.04 LTS Pro:16.04:LTS | libphp-phpmailer | 5.2.14+dfsg-1ubuntu0.1~esm1 |
| Ubuntu · Pro 18.04 LTS Pro:18.04:LTS | libphp-phpmailer | 5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1 |
| Ubuntu · Pro 20.04 LTS Pro:20.04:LTS | libphp-phpmailer | 6.0.6-0.1ubuntu0.1~esm1 |
| Ubuntu · Pro 22.04 LTS Pro:22.04:LTS | libphp-phpmailer | 6.2.0-2ubuntu0.1~esm1 |
Vulnerabilities 7
-
Critical 9.8
Remote code execution in PHPMailer
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.
KEV Jul 7, 2025 -
Critical 9.8
Remote code execution in PHPMailer
The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code by leveraging improper interaction between the escapeshellarg function and internal escaping perf…
-
High 8.8
Phar object injection in PHPMailer
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
-
High 8.1
Inclusion of Functionality from Untrusted Control Sphere in PHPMailer/PHPMailer
PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the $patternselect parameter to validateAddress() is set to 'php' (the default, defi…
-
High 7.5
Insufficient output escaping of attachment names in PHPMailer
PHPMailer before 6.1.6 contains an output escaping bug when the name of a file attachment contains a double quote character. This can result in the file type being misinterpreted by the receiver or any mail relay processing the message.
-
Medium 6.1CVE-2017-11503 Public exploit
Cross-site scripting in PHPMailer
PHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.
-
Medium 5.5CVE-2017-5223 Public exploit
Local file disclosure in PHPMailer
An issue was discovered in PHPMailer before 5.2.22. PHPMailer's msgHTML method applies transformations to an HTML document to make it usable as an email message body. One of the transformations is to convert relative image URLs into attachments using a script…
References
-
report
https://ubuntu.com/security/CVE-2016-10033
-
report
https://ubuntu.com/security/CVE-2016-10045
-
report
https://ubuntu.com/security/CVE-2017-5223
-
report
https://ubuntu.com/security/CVE-2017-11503
-
report
https://ubuntu.com/security/CVE-2018-19296
-
report
https://ubuntu.com/security/CVE-2020-13625
-
report
https://ubuntu.com/security/CVE-2021-3603