Live threats

All CVEs / Phpmailer Project

CVE-2017-5223Phpmailer Project Phpmailer

Medium 5.5

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Phpmailer.

Affected packages

EcosystemPackageAffected versionsFixed inHow 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)

VendorProductVersions
phpmailer_projectphpmailer≤ 5.2.21

Official sources

References

Links published by the sources. Open them with care.