VDB
Sign up
HIGH8.8

GHSA-7w4p-72j7-v7c2

Phar object injection in PHPMailer

Quick fix

GHSA-7w4p-72j7-v7c2 — phpmailer/phpmailer: upgrade to the fixed version with the command below.

composer require phpmailer/phpmailer:^5.2.27

Details

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](https://knasmueller.net/5-answers-about-php-phar-exploitation) 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: * Open a private issue in [the PHPMailer project](https://github.com/PHPMailer/PHPMailer)

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/phpmailer/phpmailer
Introduced in: 5.0.0Fixed in: 5.2.27
Fixcomposer require phpmailer/phpmailer:^5.2.27
Packagist/phpmailer/phpmailer
Introduced in: 6.0.0Fixed in: 6.0.6
Fixcomposer require phpmailer/phpmailer:^6.0.6

References