CVE-2017-11503: Phpmailer/phpmailer Cross-Site Scripting Vulnerability
MODERATECVE-2017-11503 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Phpmailer/phpmailer libraries in the Packagist ecosystem. The issue involves cross-site scripting in phpmailer. Remediation is available by upgrading affected packages to version 5.2.24.
CVE-2017-11503 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2017-11503
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.24
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-2017-11503, 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.24), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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-2017-11503 Affected Phpmailer/phpmailer Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpmailer/phpmailer
|
Packagist |
≥ 5.0.0
< 5.2.24
|
5.2.24
|
References
Frequently Asked Questions
What is CVE-2017-11503?
Which Phpmailer/phpmailer versions are affected?
What version fixes CVE-2017-11503?
Is phpmailer/phpmailer affected?
What is the CVSS score of CVE-2017-11503?
What CWE is associated with CVE-2017-11503?
How can I check Packagist dependencies for CVE-2017-11503?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-58mj-pw57-4vm2",
"modified" : "2021-08-19T19:44:10Z",
"published" : "2020-03-05T22:09:13Z",
"aliases" : [ "CVE-2017-11503" ],
"summary" : "Cross-site scripting in PHPMailer",
"details" : "PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, CVE-2017-11503. The code_generator.phps example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.\n\n### Impact\nPHPMailer 5.2.23 has XSS in the "From Email Address" and "To Email Address" fields of code_generator.php.\n\n### Patches\nFixed in 5.2.24\n\n### Workarounds\nNone.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2017-11503\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.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpmailer/phpmailer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.2.24"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-58mj-pw57-4vm2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-11503"
}, {
"type" : "WEB",
"url" : "https://cxsecurity.com/issue/WLB-2017060181"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2017-11503.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.24"
}, {
"type" : "WEB",
"url" : "https://packetstormsecurity.com/files/143138/phpmailer-xss.txt"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/99293"
}, {
"type" : "WEB",
"url" : "http://www.securitytracker.com/id/1039026"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-03-05T22:06:39Z",
"nvd_published_at" : null
}
}