Improper Input Validation Affecting phpmailer/phpmailer package, versions <6.1.6


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.63% (80th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PHP-PHPMAILERPHPMAILER-570519
  • published 28 May 2020
  • disclosed 28 May 2020
  • credit Unknown

How to fix?

Upgrade phpmailer/phpmailer to version 6.1.6 or higher.

Overview

Affected versions of this package are vulnerable to Improper Input Validation. An attachment with a double quote within the attachment name, eg: $mail->addAttachment('/tmp/attachment.tmp', 'filename.html";.jpg');

will result in a message containing these headers:

Content-Type: application/octet-stream; name="filename.html";.jpg"
Content-Disposition: attachment; filename="filename.html";.jpg"

The attachment will be named filename.html, and the trailing ";.jpg" will be ignored.

This can lead in bypassing mail filters based on MIME types.

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
6.1 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Changed
  • Confidentiality (C)
    Low
  • Integrity (I)
    Low
  • Availability (A)
    None
Expand this section

NVD

7.5 high