CVE-2017-9841PHPUnit
Remote Code Execution in PHPUnit via Exposed eval-stdin.php
Critical 9.8 KEV No auth neededHigh EPSS
Follow: this CVE · PHPUnit · PHPUnit We alert you by email or Slack (account required).
- Priority
- 84
- CVSS 3.1
- 9.8
- EPSS
- 100.0% probability of exploitation in 30 days · percentile 100
- Auth required
- No
- In KEV since
- Feb 15, 2022
- CISA deadline
- Aug 15, 2022
- Ransomware use
- Unknown
- Published
- Jun 27, 2017
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-94
- SSVC (CISA)
- Exploitation: active · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
PHPUnit before version 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with "<?php ". The vulnerability is exploited when the /vendor folder is publicly exposed. CISA has confirmed active exploitation of this vulnerability.
Show the original NVD text
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a "<?php " substring, as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.
Exploitation confirmed by CISA
PHPUnit allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a "<?php " substring, as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.
Action required by CISA: Apply updates per vendor instructions.
What to do
Patch available · fixed versions: 4.8.28, 5.6.3
Update PHPUnit to version 4.8.28 or later (4.x branch) or 5.6.3 or later (5.x branch). Ensure the /vendor folder is not publicly accessible.
- Apply the vendor's security update for PHPUnit.
- CISA has confirmed it is exploited: treat it as urgent. The deadline for US federal agencies was August 15, 2022.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
- Check logs for signs of earlier exploitation.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Packagist | phpunit/phpunit |
≥ 4.8.19 < 4.8.28 |
4.8.28 |
composer require "phpunit/phpunit:^4.8.28" |
| Packagist | phpunit/phpunit |
≥ 5.0.10 < 5.6.3 |
5.6.3 |
composer require "phpunit/phpunit:^5.6.3" |
Per OSV / GitHub Advisories (GHSA-r7c9-c69m-rph8). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| phpunit_project | phpunit | ≤ 4.8.27 |
| phpunit_project | phpunit | ≥ 5.0.0 < 5.6.3 |
| oracle | communications_diameter_signaling_router | ≥ 8.0.0 ≤ 8.5.0 |
Official sources
References
Links published by the sources. Open them with care.
- web.archive.org Third Party Advisory
- www.securityfocus.com Broken Link
- www.securitytracker.com Broken Link
- github.com Patch Third Party Advisory
- github.com Patch Third Party Advisory
- security.gentoo.org Third Party Advisory
- www.oracle.com Patch Third Party Advisory
- www.cisa.gov US Government Resource