# CVE-2017-9841: Code Injection in PHPUnit

Source: https://junglewise.ai/threats/cve-2017-9841-phpunit-command-injection-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-03-26. Updated: 2026-05-10  
License: CC BY 4.0 with a link back

CVE-2017-9841 · Severity: critical · CVSS 3.1 · Exploited in the wild · Published 2022-03-26

The eval-stdin.php component in PHPUnit allows remote attackers to execute arbitrary PHP code via HTTP POST data starting with a '<?php ' substring. This occurs when the /vendor folder is exposed to external access, enabling command injection.

Technologies: [phpunit/phpunit (Packagist)](https://junglewise.ai/threats/technologies/phpunit-phpunit). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2017-9841 exploited in the wild?** Yes. CVE-2017-9841 is known to be exploited in the wild, first recorded on 15 February 2022. Treat it as urgent.

**How severe is CVE-2017-9841?** Critical severity, with a CVSS score of 3.1, published 26 March 2022.

**Which products and versions are affected?** phpunit/phpunit (Packagist) ECOSYSTEM:introduced=4.8.19,fixed=4.8.28.

**Is there a fix for CVE-2017-9841?** Yes. phpunit/phpunit (Packagist): upgrade to 4.8.28 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2017-9841 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2017-9841?** Check whether you run phpunit/phpunit (Packagist) or PHPUnit at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- phpunit/phpunit (Packagist): upgrade to 4.8.28 or later

  ```sh
  composer require phpunit/phpunit:^4.8.28
  ```


## Affected products

- PHPUnit Project PHPUnit before 4.8.28, 5.x before 5.6.3
- Oracle Communications Diameter Signaling Router 8.0.0 - 8.5.0

## Identifiers

- CVE-2017-9841
- GHSA-r7c9-c69m-rph8

## Timeline

- 2017-06-24: disclosed: Initial CVE assignment date (implied by CVE ID)
- 2017-11-14: advisory: SecurityFocus BID 101798 published
- 2021-10-20: patched: Oracle released patches in Critical Patch Update
- 2022-02-15: kev added: Added to CISA Known Exploited Vulnerabilities Catalog
- 2022-02-15: exploited: Confirmed exploited in the wild per CISA KEV catalog

## Related threats

- [PHPUnit predictable temp directory in code coverage for PHPT tests](https://junglewise.ai/threats/cve-2026-119193-phpunit-is-a-testing-framework-for-php-from-13-4-0-until-13-4-4)
- [PHPUnit has Argument injection via newline in PHP INI values that are forwarded to child processes](https://junglewise.ai/threats/cve-2026-41570-phpunit-has-argument-injection-via-newline-in-php-ini-values-that)
- [PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling](https://junglewise.ai/threats/cve-2026-24765-phpunit-vulnerable-to-unsafe-deserialization-in-phpt-code)
