Arbitrary Code Execution Affecting phpunit/phpunit package, versions >=5.0.10, <5.6.3>=4.8.19, <4.8.28


Severity

Recommended
0.0
critical
0
10

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

Threat Intelligence

Exploit Maturity
Mature
EPSS
97.48% (100th 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-PHPUNITPHPUNIT-70127
  • published13 Nov 2016
  • disclosed13 Nov 2016
  • creditUnknown

Introduced: 13 Nov 2016

CVE-2017-9841  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade phpunit/phpunit to version 5.6.3, 4.8.28 or higher.

Overview

Affected versions of phpunit/phpunit are vulnerable to Arbitrary Code Execution.

Usually, phpunit is deployed using composer, a very popular dependency manager for PHP. In most cases phpunit isn't required for the production environment, but nonetheless it is installed. Placing composer modules into web accessible directory is another common mistake that allows direct exploitation of this vulnerability.

Vulnerability is located in /phpunit/src/Util/PHP/eval-stdin.php file. Before patch this file contained:

eval('?>'.file_get_contents('php://input'));

that could be used to run arbitrary PHP code.

CVSS Scores

version 3.1