CVE-2017-5223
Local file disclosure in PHPMailer
Reported by mitre · Published January 16, 2017
phpmailer/phpmailer is fixed in 5.2.22 and 5.2.21 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| phpmailer/phpmailer | Packagist | 5.2.22, 5.2.21 |
| libphp-phpmailer | Ubuntu:Pro:16.04:LTS | 5.2.14+dfsg-1ubuntu0.1~esm1 |
| phpmailer | phpmailer_project | 5.2.21 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| phpmailer | phpmailer | 0 |
| n/a | n/a | * |
Timeline
- Jan 16, 2017 CVE Published
- Oct 25, 2017 PoC Published (2 in total, the first dated here)
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Jul 18, 2025 CVE Updated
- Mar 6, 2026 Distribution Patch
- Mar 6, 2026 Security Advisory (2 in total, the first dated here)
- Sep 29, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2017-5223
vulnetix vdb fixes CVE-2017-5223
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2017-5223/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- 95328 vdb-entryx_refsource_BID
- x_refsource_MISC
- 43056 exploitx_refsource_EXPLOIT-DB
- x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2017-5223 advisory