CVE-2018-19296: Phpmailer/phpmailer Phar Object Injection Vulnerability
HIGHCVE-2018-19296 is a HIGH (CVSS 8.8) phar object injection vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Phpmailer/phpmailer libraries in the Packagist ecosystem. The issue involves phar object injection in phpmailer. Remediation is available by upgrading affected packages to version 5.2.27, 6.0.6.
CVE-2018-19296 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2018-19296
To remediate this vulnerability, upgrade all affected Phpmailer/phpmailer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade phpmailer/phpmailer to 5.2.27
Upgrade phpmailer/phpmailer to 6.0.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for phpmailer/phpmailer
How to Check if You Are Affected
To determine whether your application is affected by CVE-2018-19296, inspect your project dependencies for Phpmailer/phpmailer:
inspect dependencies for phpmailer/phpmailer
Analyze the terminal output to locate any version of Phpmailer/phpmailer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.27), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Phpmailer/phpmailer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2018-19296 Affected Phpmailer/phpmailer Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpmailer/phpmailer
|
Packagist |
≥ 5.0.0
< 5.2.27
|
5.2.27
|
|
phpmailer/phpmailer
|
Packagist |
≥ 6.0.0
< 6.0.6
|
6.0.6
|
References
Frequently Asked Questions
What is CVE-2018-19296?
Which Phpmailer/phpmailer versions are affected?
What version fixes CVE-2018-19296?
Is phpmailer/phpmailer affected?
What is the CVSS score of CVE-2018-19296?
What CWE is associated with CVE-2018-19296?
How can I check Packagist dependencies for CVE-2018-19296?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7w4p-72j7-v7c2",
"modified" : "2021-08-19T19:57:58Z",
"published" : "2020-03-05T22:08:55Z",
"aliases" : [ "CVE-2018-19296" ],
"summary" : "Phar object injection in PHPMailer",
"details" : "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](https://knasmueller.net/5-answers-about-php-phar-exploitation) 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.\n\n### Impact\nObject injection, possible remote code execution\n\n### Patches\nFixed in 6.0.6 and 5.2.27\n\n### Workarounds\nValidate and sanitise user input before using.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2018-19296\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open a private issue in [the PHPMailer project](https://github.com/PHPMailer/PHPMailer)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpmailer/phpmailer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.2.27"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpmailer/phpmailer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.0.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-7w4p-72j7-v7c2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-19296"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2018-19296.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.27"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPMailer/PHPMailer/releases/tag/v6.0.6"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2018/12/msg00020.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3B5WDPGUFNPG4NAZ6G4BZX43BKLAVA5B"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KPU66INRFY5BQ3ESVPRUXJR4DXQAFJVT"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2018/dsa-4351"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-502", "CWE-915" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-03-05T22:08:10Z",
"nvd_published_at" : "2018-11-16T09:29:00Z"
}
}