---
id: "CVE-2026-119193"
kind: "vulnerability"
aliases: ["CVE-2026-119193"]
title: "PHPUnit: predictable temp directory lets local user run code as developer"
severity: "medium"
cvss: 5.4
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["linux", "package", "php", "phpt", "phpunit", "shared-hosts"]
not_affected_if: ["per-user-temp-dir", "phpunit-12.5-or-earlier", "single-user-machine"]
published_at: "2026-10-29T20:17:30+00:00"
first_seen_at: "2026-10-29T20:26:50+00:00"
updated_at: "2026-10-29T20:28:10+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119193", "first_seen_at": "2026-10-29T20:26:50+00:00"}]
---

# PHPUnit: predictable temp directory lets local user run code as developer

PHPUnit 13.4.0 through 13.4.4 writes PHPT code coverage files to a predictable directory under the system temp path without checking ownership. On shared multi-user machines, a local attacker can pre-create that directory and swap in a malicious file that runs with the developer's privileges.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `composer show phpunit/phpunit` and confirm the installed version is not in the range `13.4.0` to `13.4.4`
- Check whether the machine is multi-user with a shared temp directory, since default macOS and Windows per-user temp paths are not affected

## Fix

- Upgrade PHPUnit to `13.4.4`

## Timeline

- 2026-10-29T20:26:50+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-119193

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
