CVE-2017-5223: Infoleak

Published Jan 6, 2016
·
Updated

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.

Affected Software

3 affected componentsFixes available
composer/phpmailer/phpmailer>=5.0.0, <5.2.22
5.2.22
debian/libphp-phpmailer
6.2.0-26.6.3-16.9.1-1
PHPMailer project PHPMailer<=5.2.21

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/phpmailer/phpmailer to a version that resolves this vulnerability.

    Fixed in 5.2.22
  2. Upgrade

    Upgrade debian/libphp-phpmailer to a version that resolves this vulnerability.

    Fixed in 6.2.0-2Fixed in 6.6.3-1Fixed in 6.9.1-1
  3. Upgrade

    Upgrade PHPMailer to a version that resolves this vulnerability.

    Fixed in 5.2.22
  4. Configuration

    When using msgHTML, always provide a base directory so relative image URLs are not resolved to '/' and treated as absolute local file paths/attachments.

    PHPMailer msgHTML base directory = set a base directory (do not leave it unset)

Event History

Jan 6, 2016
Advisory Published
09:35 PM
Jan 16, 2017
CVE Published
via MITRE·06:00 AM
Data Sourced
via MITRE·06:00 AM
Description
Data Sourced
via NVD·06:59 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·10:37 PM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·01:52 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the vulnerability ID of Local File Disclosure?

The vulnerability ID of Local File Disclosure is CVE-2017-5223.

2

What is the severity rating of CVE-2017-5223?

CVE-2017-5223 has a severity rating of 5.5 (medium).

3

What is the affected software for CVE-2017-5223?

The affected software for CVE-2017-5223 includes PHPMailer versions from 5.0.0 up to, but excluding, 5.2.22.

4

How can I fix the Local File Disclosure vulnerability?

To fix the Local File Disclosure vulnerability, update PHPMailer to version 5.2.22 or later.

5

Where can I find more information about CVE-2017-5223?

You can find more information about CVE-2017-5223 on the GitHub page for PHPMailer releases (https://github.com/PHPMailer/PHPMailer/releases/tag/v5.2.22) and the Kali Linux website (http://kalilinux.co/2017/01/12/phpmailer-cve-2017-5223-local-information-disclosure-vulnerability-analysis/).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203