Actively exploited in the wild. This CVE is on the CISA Known Exploited Vulnerabilities list — treat remediation as urgent. Federal remediation due by 15 Aug 2022.
PhpunitApplication · Phpunit Project

CVE-2017-9841

CRITICAL · 9.8 CVSS v3.1 Published 2017-06-27
Fix available
A fix is available. Upgrade to 5.6.3 or later.
See remediation →
100/100
Remediation priority · Urgent
In the wild High EPSS Remotely reachable No privileges Zero-click Patch available

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Arbitrary PHP code execution vulnerability in PHPUnit's eval-stdin.php script. Remote attackers can send PHP code via HTTP POST requests to exposed /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php, achieving remote code execution without authentication.

MitigationImmediately restrict public access to the /vendor directory via web server configuration (deny HTTP traffic) and/or remove the vulnerable eval-stdin.php file. Alternatively, update PHPUnit to version 4.8.28/5.6.3 or later.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
PhpunitApplication
Affected:<= 4.8.27>= 5.0.0, < 5.6.3
Communications Diameter Signaling RouterApplication
Affected:>= 8.0.0, <= 8.5.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify PHPUnit installation
    Check for PHPUnit by searching for composer.json, vendor/phpunit/phpunit, or the phpunit binary in your project. Run 'composer show phpunit/phpunit --available' or 'phpunit --version' to retrieve the installed version.
    Affected if The installed version is 4.8.27 or lower, or 5.0.0 through 5.6.2.
  2. Locate the vendor directory
    Search the web server document root for a /vendor folder. Common paths include /vendor, /web/vendor, or within the web application root directory.
    Affected if A /vendor directory exists and is accessible via HTTP/HTTPS on the web server.
  3. Check for vulnerable eval-stdin.php
    Attempt to access http://yourdomain/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php or similar paths under /vendor via HTTP request. The exact path varies by PHPUnit version but the file eval-stdin.php should be present in vulnerable versions.
    Affected if The eval-stdin.php file is present and returns a valid PHP response when requested via HTTP.
  4. Verify public accessibility of vendor folder
    Send an HTTP GET request to http://yourdomain/vendor/ and check if the server returns a directory listing or allows access to files within.
    Affected if The /vendor directory is publicly accessible and allows web requests to reach internal files.

You are affected if PHPUnit version 4.8.27 or lower, or between 5.0.0 and 5.6.2 is installed AND the /vendor directory containing eval-stdin.php is publicly accessible via the web server.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 5.6.3 or later
Fixed in 5.6.3
Vendor patch github.com →
Interim mitigation

Immediately restrict public access to the /vendor directory via web server configuration (deny HTTP traffic) and/or remove the vulnerable eval-stdin.php file. Alternatively, update PHPUnit to version 4.8.28/5.6.3 or later.

Recommended fix High confidence

Upgrade to PHPUnit 4.8.28+ for 4.x branch, or PHPUnit 5.6.3+ for 5.x branch (or migrate to a modern supported version like 9.x or 10.x based on PHP compatibility)

  1. Check current PHPUnit version by running 'composer show phpunit/phpunit --available' or inspecting composer.lock
  2. If using PHPUnit 4.x (version <= 4.8.27): upgrade to 4.8.28 or later, or migrate to a supported major version (6.x, 7.x, 8.x, 9.x, or 10.x depending on PHP version)
  3. If using PHPUnit 5.x (version >= 5.0.0 and < 5.6.3): upgrade to 5.6.3 or later, or migrate to a supported major version (6.x, 7.x, 8.x, 9.x, or 10.x depending on PHP version)
  4. Run 'composer update phpunit/phpunit' to install the fixed version
  5. Verify the upgrade by running 'composer show phpunit/phpunit' to confirm the installed version
  6. Run your test suite to ensure the upgrade does not break existing functionality
  7. As an additional hardening measure, ensure the /vendor directory is not publicly accessible via web server configuration (block or restrict HTTP access to /vendor/)
Caveat Upgrading between major versions (e.g., 4.x to 5.x, or 5.x to 6.x+) may introduce breaking changes in test code and requires PHP version compatibility checks; minor version upgrades within the same major version should be low-risk

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Phpunit Exploited in the wild — priority engagement
  • Consultation2.0 h
  • Implementation2.0 h
  • Testing1.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,090
Get it fixed fast

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,744.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2017-9841 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2017-9841 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data