CVE-2017-9841: RCE vulnerability in phpunit

Published Nov 13, 2016
·
Updated

Last updated 18 December 2024

Other sources

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.

— CISA

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.

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.

— GitHub

Affected Software

13 affected componentsFixes available
composer/phpunit/phpunit>=5.0.10, <5.6.3, >=4.8.19, <4.8.28
debian/phpunit
9.5.2-19.6.7-19.6.21-1
composer/phpunit/phpunit>=5.0.10<5.6.3
5.6.3
composer/phpunit/phpunit>=4.8.19<4.8.28
4.8.28
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
PHPUnit unit testing framework
Apache HTTP Server
Laravel web application framework
PHPUnit PHPUnit
composer/phpunit/phpunit>=5.0.10, <5.6.3
5.6.3
composer/phpunit/phpunit>=4.8.19, <4.8.28
4.8.28

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/phpunit to a version that resolves this vulnerability.

    Fixed in 9.5.2-1Fixed in 9.6.7-1Fixed in 9.6.21-1
  2. Upgrade

    Upgrade composer/phpunit/phpunit to a version that resolves this vulnerability.

    Fixed in 5.6.3
  3. Upgrade

    Upgrade composer/phpunit/phpunit to a version that resolves this vulnerability.

    Fixed in 4.8.28
  4. Upgrade

    Upgrade PHPUnit to a version that resolves this vulnerability.

    Fixed in 4.8.28
  5. Upgrade

    Upgrade PHPUnit to a version that resolves this vulnerability.

    Fixed in 5.6.3

Event History

Nov 13, 2016
Advisory Published
05:52 PM
Data Sourced
05:52 PM
DescriptionAffected Software
Data Sourced
via Packagist·05:52 PM
DescriptionSeverityAffected Software
Jun 27, 2017
CVE Published
via MITRE·05:00 PM
Data Sourced
via MITRE·05:00 PM
Description
Data Sourced
05:29 PM
RemedySeverityWeakness
May 18, 2020
Exploit Published
via GitHub·08:55 PM
Feb 15, 2022
Kev Listed
via CISA·12:00 AM
Data Sourced
via CISA·12:00 AM
DescriptionAffected Software
Data Sourced
via CISA·12:00 AM
Weakness
Updated
via CISA·12:00 AM
Affected Software
Mar 26, 2022
Advisory Published
via GitHub·12:19 AM
Data Sourced
via GitHub·12:19 AM
DescriptionSeverityWeaknessAffected Software
Apr 18, 2022
Data Sourced
via NVD·05:57 PM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·05:57 PM
Affected Software
Jan 16, 2024
News Published
via BleepingComputer·05:34 PM
Jan 17, 2024
News Published
via The Register·01:29 AM
Nov 21, 2024
Updated
via NVD·03:36 AM
RemedyAffected Software
Jan 22, 2025
Updated
via NVD·08:12 PM
Affected Software
Feb 7, 2025
Updated
via NVD·03:15 PM
SeverityWeaknessAffected Software
Apr 3, 2025
Updated
via NVD·08:26 PM
Affected Software
Apr 20, 2025
Updated
via NVD·01:37 AM
Affected Software
Aug 18, 2025
News Published
via The Hacker News·12:47 PM
Oct 21, 2025
Updated
via NVD·07:17 PM
Affected Software
Oct 22, 2025
Updated
via NVD·12:16 AM
Affected Software
Oct 29, 2025
News Published
via The Hacker News·03:38 PM

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2017-9841?

CVE-2017-9841 has a high severity level due to the potential for remote code execution.

2

How do I fix CVE-2017-9841?

To fix CVE-2017-9841, upgrade PHPUnit to version 5.6.3 or 4.8.28.

3

What software is affected by CVE-2017-9841?

CVE-2017-9841 affects PHPUnit versions prior to 5.6.3 and 4.8.28.

4

Can CVE-2017-9841 be exploited remotely?

Yes, CVE-2017-9841 can be exploited remotely through crafted HTTP POST requests.

5

What are the impacts of exploiting CVE-2017-9841?

Exploiting CVE-2017-9841 allows attackers to execute arbitrary PHP code on the server.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203