CVE-2017-5223 · mitre
CVE-2017-5223
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 2017-01-16, last changed 2026-06-17. Weakness: CWE-200.
Public exploits
| Source | Kind | Reference |
|---|---|---|
| exploit-db | proof-of-concept | EDB-43056 |
How to fix
Upgrade to a fixed version: phpmailer/phpmailer 5.2.22 (Packagist). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Timeline
| 2017-01-16 | Published |
| 2020-03-05 | Package advisory GHSA-4x5h-cr29-fhp6 |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 2.14% |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-4x5h-cr29-fhp6 | phpmailer/phpmailer (Packagist) | 5.2.22 |
Also known as: GHSA-4x5h-cr29-fhp6
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2021-3603 | 2021-06-17 | 8.1 | Inclusion of Functionality from Untrusted Control Sphere in PHPMailer/PHPMailer |
| CVE-2021-34551 | 2021-06-16 | 8.1 | same package: phpmailer/phpmailer (Packagist) |
| CVE-2020-36326 | 2021-04-28 | 9.8 | same package: phpmailer/phpmailer (Packagist) |
| CVE-2020-13625 | 2020-06-08 | 7.5 | same package: phpmailer/phpmailer (Packagist) |
| CVE-2018-19296 | 2018-11-16 | 8.8 | same package: phpmailer/phpmailer (Packagist) |
| CVE-2017-11503 | 2017-07-20 | 6.1 | same package: phpmailer/phpmailer (Packagist) |
| CVE-2016-10045 | 2016-12-30 | 9.8 | same package: phpmailer/phpmailer (Packagist) |
| CVE-2016-10033 KEV | 2016-12-30 | 9.8 | same package: phpmailer/phpmailer (Packagist) |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2017-5223, or call /api/v1/vulnerabilities/CVE-2017-5223. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.