CVE-2017-9841
Code Injection in PHPUnit
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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.
- Record
CVE-2017-9841- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-94
- Updated
- 2026-11-02
CVE List
9.8
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.
- Record
CVE-2017-9841- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2022-1528
9.8
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.
- Record
EUVD-2022-1528- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-r7c9-c69m-rph8
9.8
Code Injection in PHPUnit
Util/PHP/eval-stdin.php in PHPUnit starting with 4.8.19 and before 4.8.28, as well as 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.
- Record
GHSA-r7c9-c69m-rph8- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H - Weakness
- CWE-94
- Updated
- 2026-11-02
CISA KEV No score
PHPUnit Command Injection Vulnerability
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.
- Record
CVE-2017-9841- Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
9.8
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.
- Record
CVE-2017-9841- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVDEBIAN-CVE-2017-9841
9.8
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.
- Record
DEBIAN-CVE-2017-9841- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-r7c9-c69m-rph8
9.8
Code Injection in PHPUnit
Util/PHP/eval-stdin.php in PHPUnit starting with 4.8.19 and before 4.8.28, as well as 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.
- Record
GHSA-r7c9-c69m-rph8- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2017-9841
9.8
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.
- Record
UBUNTU-CVE-2017-9841- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2017-0429 No score
Updated mediawiki packages fix security vulnerabilities
XSS when $wgShowExceptionDetails = false and browser sends non-standard url escaping (CVE-2017-8808).
Reflected File Download from api.php (CVE-2017-8809).
On private wikis, login form shouldn't distinguish between login failure due to bad username and bad password (CVE-2017-8810).
It's possible to mangle HTML via raw message parameter expansion (CVE-2017-8811).
The id attribute on headlines allow raw > (CVE-2017-8812).
Language converter can be tricked into replacing text inside tags by adding a lot of junk after the rule definition (CVE-2017-8814).
Language converter: unsafe attribute injection via glossary rules (CVE-2017-8815).
composer.json has require-dev versions of PHPUnit with known security issues (CVE-2017-9841).
Note that MediaWiki 1.23.x on Mageia 5 is no longer supported. Those using the mediawiki package on Mageia 5 should upgrade to Mageia 6.
- Record
MGASA-2017-0429- Updated
- 2026-11-02
OSVUSN-7171-1 No score
phpunit vulnerability
It was discovered that PHPUnit incorrectly handled web requests if exposed to the internet. An attacker could possibly use this issue to achive remote code execution or obtain sensitive information.
- Record
USN-7171-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
phpunit/phpunitPackagist |
4.8.19 up to 4.8.28 | 4.8.28 |
phpunit/phpunitPackagist |
5.0.10 up to 5.6.3 | 5.6.3 |
phpunitDebian:12 |
before 5.4.6-2 | 5.4.6-2 |
phpunitDebian:13 |
before 5.4.6-2 | 5.4.6-2 |
phpunitDebian:14 |
before 5.4.6-2 | 5.4.6-2 |
phpunit/phpunitPackagist |
4.8.19 up to 4.8.28, plus listed versions 4.8.204.8.214.8.224.8.234.8.244.8.254.8.264.8.27 |
4.8.28 |
phpunit/phpunitPackagist |
5.0.10 up to 5.6.3, plus listed versions 5.1.05.1.15.1.25.1.35.1.4 Show 42 moreShow less5.1.55.1.65.1.75.2.05.2.15.2.105.2.115.2.125.2.25.2.35.2.45.2.55.2.65.2.75.2.85.2.95.3.05.3.15.3.25.3.35.3.45.3.55.4.05.4.15.4.25.4.35.4.45.4.55.4.65.4.75.4.85.5.05.5.15.5.25.5.35.5.45.5.55.5.65.5.75.6.05.6.15.6.2 |
5.6.3 |
mediawikiMageia:6 |
before 1.27.4-1.mga6 | 1.27.4-1.mga6 |
phpunitUbuntu:Pro:16.04:LTS |
before 5.1.3-1+ubuntu3+esm1, plus listed versions 4.7.6-14.8.16-15.1.3-1ubuntu15.1.3-1+build15.1.3-1+ubuntu15.1.3-1+ubuntu3 |
5.1.3-1+ubuntu3+esm1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | mbrasile/CVE-2017-9841 | 2020-01-06 |
| PoC in GitHub | RandomRobbieBF/phpunit-brute | 2020-05-18 |
| PoC in GitHub | cyberharsh/Php-unit-CVE-2017-9841 | 2020-06-24 |
| PoC in GitHub | ludy-dev/PHPUnit_eval-stdin_RCE | 2020-09-14 |
| PoC in GitHub | incogbyte/laravel-phpunit-rce-masscaner | 2021-07-04 |
| Exploit-DB | PHP Unit 4.8.28 - Remote Code Execution (RCE) (Unauthenticated) | 2022-02-02 |
| PoC in GitHub | akr3ch/CVE-2017-9841 | 2022-03-20 |
| PoC in GitHub | p1ckzi/CVE-2017-9841 | 2022-04-09 |
| PoC in GitHub | jax7sec/CVE-2017-9841 | 2022-04-20 |
| PoC in GitHub | mileticluka1/eval-stdin | 2022-10-20 |
Show 10 moreShow less
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | dream434/CVE-2017-9841 | 2022-11-21 |
| PoC in GitHub | MadExploits/PHPunit-Exploit | 2022-12-07 |
| PoC in GitHub | MrG3P5/CVE-2017-9841 | 2023-03-13 |
| PoC in GitHub | Chocapikk/CVE-2017-9841 | 2023-08-27 |
| PoC in GitHub | joelindra/CVE-2017-9841 | 2025-04-22 |
| PoC in GitHub | drcrypterdotru/PHPUnit-GoScan | 2025-08-30 |
| PoC in GitHub | krisdewa/CVE-2017-9841-PHPUnit-Remote-Code-Execution-PoC | 2026-06-11 |
| PoC in GitHub | CheLover86/CVE-2017-9841 | 2026-10-01 |
| PoC in GitHub | CyberCTF/vulhub-phpunit-cve-2017-9841 | 2026-10-08 |
| Nuclei | PHPUnit - Remote Code Execution |
History
| Recorded | Changed | Sources |
|---|---|---|
| exploitation, exploits | ||
| first indexed | CVE List, EUVD, Exploit-DB, GitHub Advisories, CISA KEV, Nuclei, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2017-9841 is a critical vulnerability (CVSS 9.8) in Phpunit, published June 27, 2017. CISA lists it as known to be exploited, since February 15, 2022. EUVD reports exploitation since February 15, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 100.0%, the 99th percentile. Fixed in phpunit/phpunit 4.8.28.
References
securityfocus.com/bid/101798
securitytracker.com/id/1039812
security.gentoo.org/glsa/201711-15
oracle.com/security-alerts/cpuoct2021.html
github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5
github.com/sebastianbergmann/phpunit/pull/1956
Show 17 moreShow less
web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com
cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-9841
nvd.nist.gov/vuln/detail/CVE-2017-9841
github.com/sebastianbergmann/phpunit/pull/1955
github.com/sebastianbergmann/phpunit/commit/3aaddb1c5bd9b9b8d070b4cf120e71c36fd08412
github.com/FriendsOfPHP/security-advisories/blob/master/phpunit/phpunit/CVE-2017-9841.yaml
github.com/advisories/GHSA-r7c9-c69m-rph8
security-tracker.debian.org/tracker/CVE-2017-9841
github.com/sebastianbergmann/phpunit
advisories.mageia.org/MGASA-2017-0429.html
bugs.mageia.org/show_bug.cgi?id=22038
lists.wikimedia.org/pipermail/mediawiki-announce/2017-November/000216.html
ubuntu.com/security/CVE-2017-9841
phpunit.vulnbusters.com
cve.org/CVERecord?id=CVE-2017-9841
cisa.gov/known-exploited-vulnerabilities-catalog
ubuntu.com/security/notices/USN-7171-1