phpunit/phpunit security advisory
CVE-2026-119193: PHPUnit vulnerable to code execution by other local users via shared temporary directory in PHPT code coverage handling
CVE-2026-119193 is a medium-severity remote code execution vulnerability in the PHP package phpunit/phpunit (CVSS 5.4), published 29 October 2026. It is fixed in 13.4.4; earlier versions are affected. Exploiting it needs a low-privilege user account.
medium 5.4 published 2026-10-29 · updated 2026-10-30
- Affected versions
- >= 13.4.0, < 13.4.4
- Fixed in
- 13.4.4
- Newest release
- 13.4.6
- Severity
- Medium · CVSS 5.4
- Type
- Remote code execution
CWE-379 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your phpunit/phpunit version affected?
Who can exploit CVE-2026-119193
- Access: A normal, low-privilege user account in the app.
- Interaction: A user also has to do something, such as open a link or a page the attacker prepared.
- Position: The attacker needs local access to the server.
- Conditions: It only works under specific conditions the attacker does not fully control (CVSS rates the attack as high complexity).
CVSS vector (scored by GitHub): CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
How to fix CVE-2026-119193 in phpunit/phpunit
- Find the installed version:
composer show phpunit/phpunit. If you never required it yourself,composer why phpunit/phpunitshows which package pulls it in. - Update it:
composer update phpunit/phpunit --with-all-dependencies. You need 13.4.4 or newer. - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"phpunit/phpunit": "^13.4.4"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-119193. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Never pass user-controlled data to unserialize() or to template rendering, and restrict who can edit templates or settings.
- Put a web application firewall in front of the app and watch for new PHP files or admin users.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-119193 advisory
PHPUnit is a testing framework for PHP. From 13.4.0 until 13.4.4, the TestCase::coverageFilesDirectory() logic in src/Runner/Phpt/TestCase.php creates temporary files for PHPT code coverage in a predictable phpunit-phpt directory under sys_get_temp_dir() and reuses that directory without verifying its ownership or permissions. On multi-user systems with a shared temporary path, a local attacker who creates the directory before the developer runs PHPT tests with code coverage can replace the generated job file before the child process executes it with require, allowing arbitrary code execution with the developer's privileges while the test and coverage report appear successful. PHPUnit 12.5 and earlier, default macOS and Windows configurations with per-user temporary directories, and single-user environments where another user cannot create files in the temporary path are not affected. This issue is fixed in 13.4.4.
References
- GitHub security advisory GHSA-9vw2-f4vp-x7gf github.com
- Fix commit ae31c78 github.com
- Release 13.4.4 github.com
Other phpunit/phpunit advisories
- high PHPUnit: Argument injection via newline in PHP INI values forwarded to child processes 2026-04-22
- high CVE-2026-41570: Argument injection via newline in PHP INI values forwarded to child processes 2026-04-17
- high CVE-2026-24765: Unsafe Deserialization in PHPT Code Coverage Handling 2026-01-27
- critical CVE-2017-9841: RCE vulnerability in phpunit 2016-11-13
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.