<?php echo 'Vulnerable'; ?>
CVE-2017-9841 CVSS Score: 9.8 (Critical) Affected Versions: PHPUnit 4.x, 5.x, 6.x (specific subversions before the patch) Vector: Network Complexity: Low Privileges Required: None User Interaction: None vendor phpunit phpunit src util php eval-stdin.php cve
If you have ever run composer install on a legacy project, pulled a popular CMS like Drupal, WordPress, or Magento, or inherited a decade-old codebase, chances are you have—unknowingly—hosted this backdoor. block /vendor/ |
eval('?>' . file_get_contents('php://stdin')); and most importantly
PHPUnit is a widely-used testing framework for PHP applications, and as with any popular software, it is a prime target for security researchers and attackers alike. Recently, a critical vulnerability was discovered in PHPUnit, which highlights the importance of keeping your dependencies up-to-date and understanding the potential risks associated with them. In this article, we'll delve into the details of the vulnerability, its impact, and most importantly, how to protect your applications against it.
Inside older versions of PHPUnit, developers included a utility helper file designed to facilitate testing via command-line arguments and standard input pipes. That file was located at: vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php
| Item | Detail | |-------------------|--------| | | CVE-2017-9841 | | Component | PHPUnit eval-stdin.php | | Attack vector | HTTP request to vulnerable script | | Impact | Remote Code Execution (RCE) | | Fix | Update PHPUnit, remove file, block /vendor/ |