{"id":"CVE-2017-9841","kind":"vulnerability","aliases":["CVE-2017-9841"],"related":[],"title":"PHPUnit PHPUnit: PHPUnit Command Injection Vulnerability","description":"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.\n\nCISA required action: Apply updates per vendor instructions.","summary":"PHPUnit's eval-stdin.php script executes any PHP code sent in an HTTP POST body that starts with \"<?php \". An attacker who can reach that file over the web runs arbitrary code on the server.","severity":"critical","cvss":9.8,"epss":0.99999,"exploited":true,"exploited_at":"2022-02-15T00:00:00+00:00","products":[{"name":"PHPUnit PHPUnit","fixed":[],"affected":"","ecosystem":"vendor"}],"ecosystems":["vendor"],"tags":["composer","exploited","package","php","phpunit","self-hosted","web-apps"],"not_affected_if":["phpunit-not-in-production","vendor-dir-not-web-accessible"],"how_to_check":"Check whether a web-reachable path exposes /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php, for example: curl -I https://your-site/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php\nCheck whether phpunit is installed in production: composer show phpunit/phpunit","fix":"Remove phpunit from production dependencies (composer install --no-dev) and block public access to the /vendor directory.\nUpdate PHPUnit to a fixed version per vendor instructions; exact fixed version not stated in the sources.","status":"open","published_at":"2017-06-27T17:29:00+00:00","first_seen_at":"2026-10-23T19:11:52+00:00","triaged_at":"2026-10-23T21:26:33+00:00","updated_at":"2026-10-23T21:57:35+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-23T21:26:33Z","model":"claude-haiku-5-5","output":{"fix":"Remove phpunit from production dependencies (composer install --no-dev) and block public access to the /vendor directory.\nUpdate PHPUnit to a fixed version per vendor instructions; exact fixed version not stated in the sources.","reach":"internet","impact":"high","summary":"PHPUnit's eval-stdin.php script executes any PHP code sent in an HTTP POST body that starts with \"<?php \". An attacker who can reach that file over the web runs arbitrary code on the server.","category":"package","who_cares":["php","phpunit","composer","self-hosted","web-apps"],"confidence":0.8,"needs_auth":"no","worst_case":"Remote attackers execute arbitrary PHP code on the server.","analyst_note":"Confirm the affected and fixed PHPUnit version ranges from the NVD or vendor advisory; the sources provided do not list them.","how_to_check":"Check whether a web-reachable path exposes /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php, for example: curl -I https://your-site/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php\nCheck whether phpunit is installed in production: composer show phpunit/phpunit\nunknown for other paths.","needs_analyst":true,"not_affected_if":["phpunit-not-in-production","vendor-dir-not-web-accessible"],"user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000551,"input_tokens":2895,"output_tokens":523,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'-2017':8A,11A '-9841':9A,12A '/vendor':89C '/vendor/phpunit/phpunit/src/util/php/eval-stdin.php':96C 'access':93C 'action':100C 'allow':61C 'app':25B 'appli':101C 'arbitrari':55B,66C 'attack':45B,63C,82C 'begin':73C 'bodi':39B 'cisa':98C 'code':33B,56B,68C 'command':4A 'compos':15B 'cve':7A,10A 'data':72C 'demonstr':79C 'eval-stdin.php':28B 'execut':30B,65C 'exploit':16B 'expos':88C 'extern':92C 'file':50B 'folder':90C 'host':22B 'http':37B,70C 'i.e':91C 'inject':5A 'instruct':105C 'packag':17B 'per':103C 'php':18B,32B,43B,67C,76C 'phpunit':1A,2A,3A,13A,14A,19B,26B,60C 'post':38B,71C 'reach':48B 'remot':62C 'requir':99C 'run':54B 'script':29B 'self':21B 'self-host':20B 'sent':34B 'server':59B 'site':85C 'start':41B 'substr':77C 'updat':102C 'uri':97C 'vendor':104C 'via':69C 'vulner':6A 'web':24B,53B 'web-app':23B","nicknames":[],"mitigations":[],"who_affected":null,"tier":null,"verified":{},"analyst_revisit_at":null,"first_public_at":"2017-06-27T17:29:00+00:00","kev":{"dateAdded":"2022-02-15","dueDate":"2022-08-15","requiredAction":"Apply updates per vendor instructions.","knownRansomwareCampaignUse":"Unknown"},"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"nvd@nist.gov","poc_count":0,"sources":[{"source":"kev","external_id":"CVE-2017-9841","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2017-9841","severity":null,"published_at":"2022-02-15T00:00:00+00:00","modified_at":null,"first_seen_at":"2026-10-23T19:11:52+00:00","fetched_at":"2026-10-25T13:39:32+00:00","note":null},{"source":"epss","external_id":"CVE-2017-9841","url":"https://api.first.org/data/v1/epss?cve=CVE-2017-9841","severity":null,"published_at":null,"modified_at":null,"first_seen_at":"2026-10-23T19:13:44+00:00","fetched_at":"2026-10-23T19:13:44+00:00","note":null},{"source":"nvd","external_id":"CVE-2017-9841","url":"https://nvd.nist.gov/vuln/detail/CVE-2017-9841","severity":null,"published_at":"2017-06-27T17:29:00+00:00","modified_at":"2026-06-17T01:29:01+00:00","first_seen_at":"2026-10-23T21:57:35+00:00","fetched_at":"2026-10-23T21:57:35+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}