Vulnerability record · CVE-2017-5223 · published 16 January 2017
CVE-2017-5223: Phpmailer project phpmailer information exposure vulnerability
Phpmailer Project · 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-provided base directory. If no base directory is provided, it resolves to /, meaning that relative image URLs get treated as absolute local file paths and added as attachments. To form a remote vulnerability, the msgHTML method must be called, passed an unfiltered, user-supplied HTML document, and must not set a base directory.
Description
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-provided base directory. If no base directory is provided, it resolves to /, meaning that relative image URLs get treated as absolute local file paths and added as attachments. To form a remote vulnerability, the msgHTML method must be called, passed an unfiltered, user-supplied HTML document, and must not set a base directory.
CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| http://kalilinux.co/2017/01/12/phpmailer-cve-2017-5223-local-information-disclosure-vulnerability-analysis/ | ExploitThird Party Advisory |
| http://www.securityfocus.com/bid/95328 | Third Party AdvisoryVDB Entry |
| https://github.com/PHPMailer/PHPMailer/blob/master/SECURITY.md | Issue TrackingPatchThird Party Advisory |
| https://www.exploit-db.com/exploits/43056/ | |
| http://kalilinux.co/2017/01/12/phpmailer-cve-2017-5223-local-information-disclosure-vulnerability-analysis/ | ExploitThird Party Advisory |
| http://www.securityfocus.com/bid/95328 | Third Party AdvisoryVDB Entry |
| https://github.com/PHPMailer/PHPMailer/blob/master/SECURITY.md | Issue TrackingPatchThird Party Advisory |
| https://www.exploit-db.com/exploits/43056/ |
Track CVE-2017-5223 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2017-5223), CISA KEV, FIRST EPSS (scores of 2026-10-06). This page is refreshed as NVD updates the record.