CVE-2017-5223Phpmailer Project Phpmailer
Medium 5.5
Follow: this CVE · Phpmailer Project · Phpmailer Project Phpmailer We alert you by email or Slack (account required).
- Priority
- 33
- CVSS 3.0
- 5.5
- EPSS
- 2.1% probability of exploitation in 30 days · percentile 83
- Auth required
- Yes
- Published
- Jan 16, 2017
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-200
- Vector
CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
What happens
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.
What to do
- Apply the vendor's security update for Phpmailer.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Packagist | phpmailer/phpmailer |
≥ 5.0.0 < 5.2.22 |
5.2.22 |
composer require "phpmailer/phpmailer:^5.2.22" |
Per OSV / GitHub Advisories (GHSA-4x5h-cr29-fhp6). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| phpmailer_project | phpmailer | ≤ 5.2.21 |
Official sources
References
Links published by the sources. Open them with care.
- kalilinux.co Exploit Third Party Advisory
- www.securityfocus.com Third Party Advisory VDB Entry
- github.com Issue Tracking Patch Third Party Advisory
- www.exploit-db.com