Arbitrary File Disclosure

Affecting phpmailer/phpmailer package, versions <5.2.22

Do your applications use this vulnerable package? Test your applications

Overview

Affected versions of phpmailer/phpmailer are vulnerable to Local File Disclosure.

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.

Remediation

Upgrade phpmailer/phpmailer to version 5.2.22 or higher.

References

CVSS Score

5.5
medium severity
  • Attack Vector
    Local
  • Attack Complexity
    Low
  • Privileges Required
    Low
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    None
  • Availability
    None
CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N/E:P/RL:O/RC:R
Credit
Unknown
CVE
CVE-2017-5223
CWE
CWE-200
Snyk ID
SNYK-PHP-PHPMAILERPHPMAILER-70126
Disclosed
06 Jan, 2016
Published
06 Jan, 2016