CVE-2017-5223
MEDIUM 5.5CVSS 3.0Local 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-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.
- Published
- 16 Jan 2017
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-200
- Also known as
- GHSA-4x5h-cr29-fhp6
- Sources
- NVDJSONOSV GHSA-4x5h-cr29-fhp6JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.0 | MEDIUM 5.5 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| OSV | GitHub | CVSS 3.0 | MEDIUM 5.5 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | LOW 2.1 | AV:L/AC:L/Au:N/C:P/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | phpmailer_project | phpmailercpe:2.3:a:phpmailer_project:phpmailer:*:*:*:*:*:*:*:* |
<= 5.2.21 | |
| OSV | Packagist | phpmailer/phpmailer | >= 5.0.0, < 5.2.22 | 5.2.22 |
References
- http://kalilinux.co/2017/01/12/phpmailer-cve-2017-5223-local-information-disclosure-vulnerability-analysis/ · Exploit, Third Party Advisory, WEB
- http://www.securityfocus.com/bid/95328 · Third Party Advisory, VDB Entry, WEB
- https://github.com/PHPMailer/PHPMailer/blob/master/SECURITY.md · Issue Tracking, Patch, Third Party Advisory, WEB
- https://www.exploit-db.com/exploits/43056/ · WEB
- https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-4x5h-cr29-fhp6 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2017-5223 · ADVISORY
- https://github.com/FriendsOfPHP/security-advisories/blob/master/phpmailer/phpmailer/CVE-2017-5223.yaml · WEB
- https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.22 · WEB
History
- 25 Nov 2026 20:19 UTC · NVD: first stored (published 16 Jan 2017)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 5 Mar 2020)