Quick answers
- Is CVE-2017-5223 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2017-5223 being exploited in the wild.
- How severe is CVE-2017-5223?
- Medium severity, with a CVSS score of 5.5, published 16 January 2017.
- Which products and versions are affected?
- phpmailer/phpmailer (Packagist) ECOSYSTEM:introduced=5.0.0,fixed=5.2.22.
- Is there a fix for CVE-2017-5223?
- Yes. phpmailer/phpmailer (Packagist): upgrade to 5.2.22 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2017-5223 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2017-5223?
- Check whether you run phpmailer/phpmailer (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- phpmailer/phpmailer (Packagist): upgrade to 5.2.22 or later
composer require phpmailer/phpmailer:^5.2.22
Technical details
A local file disclosure vulnerability exists in PHPMailer's msgHTML method. The method automatically converts relative image URLs into email attachments. If a developer passes unfiltered user input to msgHTML without specifying a base directory, the library defaults to the root directory (/). An attacker can exploit this by submitting an HTML message containing an <img> tag with a 'src' attribute pointing to a sensitive local file (e.g., <img src='/etc/passwd'>). PHPMailer will then resolve this as an absolute path and attach the requested file to the outgoing email. This vulnerability is mitigated in version 5.2.22.
Affected products
- PHPMailer project PHPMailer < 5.2.22
Identifiers
- CVE-2017-5223
- GHSA-4x5h-cr29-fhp6
Timeline
- 2017-01-09: patched: Version 5.2.22 released
- 2017-01-16: disclosed: NVD publication date
- 2017-10-25: other: Public exploit code released on Exploit-DB