CVE-2017-9841
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 · uneditedUtil/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 confidenceArbitrary 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.
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<= 4.8.27>= 5.0.0, < 5.6.3>= 8.0.0, <= 8.5.0CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Identify PHPUnit installationCheck 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.
-
Locate the vendor directorySearch 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.
-
Check for vulnerable eval-stdin.phpAttempt 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.
-
Verify public accessibility of vendor folderSend 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.
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 · scoped5.6.3
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.
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)
- Check current PHPUnit version by running 'composer show phpunit/phpunit --available' or inspecting composer.lock
- 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)
- 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)
- Run 'composer update phpunit/phpunit' to install the fixed version
- Verify the upgrade by running 'composer show phpunit/phpunit' to confirm the installed version
- Run your test suite to ensure the upgrade does not break existing functionality
- As an additional hardening measure, ensure the /vendor directory is not publicly accessible via web server configuration (block or restrict HTTP access to /vendor/)
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation2.0 h
- Testing1.0 h
- Review / QA1.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2017-9841 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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