Skip to content

Phar object injection in PHPMailer

High severity GitHub Reviewed Published Mar 5, 2020 in PHPMailer/PHPMailer • Updated Jan 24, 2024

Package

composer phpmailer/phpmailer (Composer)

Affected versions

>= 5.0.0, < 5.2.27
>= 6.0.0, < 6.0.6

Patched versions

5.2.27
6.0.6

Description

PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing phar:// paths into addAttachment() and other functions that may receive unfiltered local paths, possibly leading to RCE. See this article for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as phar://. Reported by Sehun Oh of cyberone.kr.

Impact

Object injection, possible remote code execution

Patches

Fixed in 6.0.6 and 5.2.27

Workarounds

Validate and sanitise user input before using.

References

https://nvd.nist.gov/vuln/detail/CVE-2018-19296

For more information

If you have any questions or comments about this advisory:

References

Published by the National Vulnerability Database Nov 16, 2018
@Synchro Synchro published to PHPMailer/PHPMailer Mar 5, 2020
Reviewed Mar 5, 2020
Published to the GitHub Advisory Database Mar 5, 2020
Last updated Jan 24, 2024

Severity

High
8.8
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2018-19296

GHSA ID

GHSA-7w4p-72j7-v7c2

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.