CVE-2017-9841: PHPUnit Command Injection Vulnerability

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

11 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 PHPUnit
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

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 debian/phpunit to a version that resolves this vulnerability.

    Fixed in 9.5.2-1
  5. Upgrade

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

    Fixed in 9.6.7-1
  6. Upgrade

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

    Fixed in 9.6.21-1

Event History

Nov 13, 2016
Advisory Published
05:52 PM
Jun 27, 2017
CVE Published
via MITRE·05:00 PM
Data Sourced
via MITRE·05:00 PM
Description
Data Sourced
via NVD·05:29 PM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 15, 2022
Known Exploited
via CISA·12:00 AM
Jan 16, 2024
News Published
via BleepingComputer·05:34 PM
Jan 17, 2024
News Published
via The Register·01:29 AM
Jan 20, 2024
News Published
via BleepingComputer·05:35 PM
Jan 21, 2024
News Published
via The Register·01:34 AM
Dec 18, 2024
Data Sourced
via Launchpad·02:19 PM
Description
Dec 22, 2024
Data Sourced
via Ubuntu·02:18 PM
RemedyDescriptionSeverityAffected Software

Peer vulnerabilities

Found alongside the following vulnerabilities.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

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