Arbitrary Code Execution Affecting phpmailer/phpmailer package, versions <6.5.0


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
2.4% (91st 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 Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-PHPMAILERPHPMAILER-1311002
  • published17 Jun 2021
  • disclosed17 Jun 2021
  • creditJilin Diting Information Technology Co., Ltd

Introduced: 17 Jun 2021

CVE-2021-34551  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade phpmailer/phpmailer to version 6.5.0 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Execution. If the $lang_path parameter is passed unfiltered from user input, it can be set to a UNC path, and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility.

References

CVSS Scores

version 3.1