CVE-2018-19296
Phar object injection in PHPMailer
CVE-2018-19296 is a high vulnerability (CVSS 8.8) in Phpmailer Project Phpmailer, published November 16, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.23%, the 82nd percentile. Fixed in phpmailer/phpmailer 5.2.27.
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
8.8
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
- Record
CVE-2018-19296- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - CVSS 2.0
- 6.8 Medium
AV:N/AC:M/Au:N/C:P/I:P/A:P - Weakness
- CWE-502, CWE-1321
- Updated
- 2026-11-02
CVE List No score
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
- Record
CVE-2018-19296- Updated
- 2026-11-02
EUVDEUVD-2020-0340 No score
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
- Record
EUVD-2020-0340- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-7w4p-72j7-v7c2
8.8
Phar object injection in PHPMailer
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing phar:// paths into addAttachment() and other functions that may receive unfiltered local paths, possibly leading to RCE. See this article for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as phar://. Reported by Sehun Oh of cyberone.kr.
Impact
Object injection, possible remote code execution
Patches
Fixed in 6.0.6 and 5.2.27
Workarounds
Validate and sanitise user input before using.
References
https://nvd.nist.gov/vuln/detail/CVE-2018-19296
For more information
If you have any questions or comments about this advisory:
- Open a private issue in the PHPMailer project
- Record
GHSA-7w4p-72j7-v7c2- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-502, CWE-915, CWE-1321
- Updated
- 2026-11-02
OSV
8.8
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
- Record
CVE-2018-19296- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2018-19296
8.8
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
- Record
DEBIAN-CVE-2018-19296- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-7w4p-72j7-v7c2
8.8
Phar object injection in PHPMailer
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing phar:// paths into addAttachment() and other functions that may receive unfiltered local paths, possibly leading to RCE. See this article for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as phar://. Reported by Sehun Oh of cyberone.kr.
Impact
Object injection, possible remote code execution
Patches
Fixed in 6.0.6 and 5.2.27
Workarounds
Validate and sanitise user input before using.
References
https://nvd.nist.gov/vuln/detail/CVE-2018-19296
For more information
If you have any questions or comments about this advisory:
- Open a private issue in the PHPMailer project
- Record
GHSA-7w4p-72j7-v7c2- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-1321, CWE-502, CWE-915
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2018-19296
8.8
PHPMailer before 5.2.27 and 6.x before 6.0.6 is vulnerable to an object injection attack.
- Record
UBUNTU-CVE-2018-19296- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - CVSS 3.0
- 8.8 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2019-0010 No score
Updated php-phpmailer package fixes security vulnerability
Potential object injection vulnerability (CVE-2018-19296).
- Record
MGASA-2019-0010- Updated
- 2026-11-02
OSVUSN-5956-1 No score
libphp-phpmailer vulnerabilities
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)
- Record
USN-5956-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
phpmailer/phpmailerPackagist |
5.0.0 up to 5.2.27 | 5.2.27 |
phpmailer/phpmailerPackagist |
6.0.0 up to 6.0.6 | 6.0.6 |
libphp-phpmailerDebian:12 |
before 5.2.14+dfsg-2.4 | 5.2.14+dfsg-2.4 |
libphp-phpmailerDebian:13 |
before 5.2.14+dfsg-2.4 | 5.2.14+dfsg-2.4 |
libphp-phpmailerDebian:14 |
before 5.2.14+dfsg-2.4 | 5.2.14+dfsg-2.4 |
libphp-phpmailerDebian:8 |
before 5.2.9+dfsg-2+deb8u4, plus listed versions 5.2.9+dfsg-25.2.9+dfsg-2+deb8u15.2.9+dfsg-2+deb8u25.2.9+dfsg-2+deb8u3 |
5.2.9+dfsg-2+deb8u4 |
libphp-phpmailerDebian:9 |
before 5.2.14+dfsg-2.3+deb9u1, plus listed versions 5.2.14+dfsg-2.3 |
5.2.14+dfsg-2.3+deb9u1 |
phpmailer/phpmailerPackagist |
5.0.0 up to 5.2.27, plus listed versions v5.2.10v5.2.11v5.2.12v5.2.13v5.2.14 Show 19 moreShow lessv5.2.15v5.2.16v5.2.17v5.2.18v5.2.19v5.2.2v5.2.20v5.2.21v5.2.22v5.2.23v5.2.24v5.2.25v5.2.26v5.2.4v5.2.5v5.2.6v5.2.7v5.2.8v5.2.9 |
5.2.27 |
phpmailer/phpmailerPackagist |
6.0.0 up to 6.0.6, plus listed versions v6.0.0v6.0.1v6.0.2v6.0.3v6.0.4v6.0.5 |
6.0.6 |
php-phpmailerMageia:6 |
before 5.2.27-1.1.mga6 | 5.2.27-1.1.mga6 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
libphp-phpmailerUbuntu:Pro:16.04:LTS |
before 5.2.14+dfsg-1ubuntu0.1~esm1, plus listed versions 5.2.10+dfsg-15.2.14+dfsg-15.2.14+dfsg-1build1 |
5.2.14+dfsg-1ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:18.04:LTS |
before 5.2.14+dfsg-2.3+deb9u1build0.18.04.1, plus listed versions 5.2.14+dfsg-2.3 |
5.2.14+dfsg-2.3+deb9u1build0.18.04.1 |
libphp-phpmailerUbuntu:Pro:18.04:LTS |
before 5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1, plus listed versions 5.2.14+dfsg-2.35.2.14+dfsg-2.3+deb9u1build0.18.04.15.2.14+dfsg-2.3+deb9u2build0.18.04.1 |
5.2.14+dfsg-2.3+deb9u2ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:Pro:20.04:LTS |
before 6.0.6-0.1ubuntu0.1~esm1, plus listed versions 6.0.6-0.1 |
6.0.6-0.1ubuntu0.1~esm1 |
libphp-phpmailerUbuntu:Pro:22.04:LTS |
before 6.2.0-2ubuntu0.1~esm1, plus listed versions 6.2.0-2 |
6.2.0-2ubuntu0.1~esm1 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-03 | aliases | EUVD |
| 2026-11-02 | created | CVE List, GitHub Advisories, NVD, OSV |
References
github.com/PHPMailer/PHPMailer/releases/tag/v5.2.27
lists.debian.org/debian-lts-announce/2018/12/msg00020.html
debian.org/security/2018/dsa-4351
github.com/PHPMailer/PHPMailer/releases/tag/v6.0.6
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B
Show 20 moreShow less
github.com/PHPMailer/PHPMailer/security/advisories/GHSA-7w4p-72j7-v7c2
nvd.nist.gov/vuln/detail/CVE-2018-19296
github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2018-19296.yaml
lists.fedoraproject.org/archives/list/[email protected]/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B
lists.fedoraproject.org/archives/list/[email protected]/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT
github.com/advisories/GHSA-7w4p-72j7-v7c2
security-tracker.debian.org/tracker/CVE-2018-19296
advisories.mageia.org/MGASA-2019-0010.html
bugs.mageia.org/show_bug.cgi?id=24055
lists.fedoraproject.org/archives/list/[email protected]/thread/DAZQPUD7WZXMJ2KIQY5P2I2UI545YPYO
ubuntu.com/security/CVE-2018-19296
github.com/PHPMailer/PHPMailer/commit/f1231a9771505f4f34da060390d82eadb8448271
ubuntu.com/security/notices/USN-5956-1
cve.org/CVERecord?id=CVE-2018-19296
ubuntu.com/security/CVE-2016-10033
ubuntu.com/security/CVE-2016-10045
ubuntu.com/security/CVE-2017-5223
ubuntu.com/security/CVE-2017-11503
ubuntu.com/security/CVE-2020-13625
ubuntu.com/security/CVE-2021-3603