# CVE-2026-84373: Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock

> Remote attackers can read arbitrary local files via path traversal in Vitest's mocker plugin when the development server is exposed.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Sep 2026
- **Updated:** 2 Sep 2026
- **Also known as:** CLEANSTART-2026-BX79488, CLEANSTART-2026-MR36651, CLEANSTART-2026-RG48611, CLSA-2026-1789478968, CLSA-2026-1792160943, CLSA-2026-1792160957, CLSA-2026-1792161472, CLSA-2026-1792161573, CLSA-2026-1792161646, CLSA-2026-1792161718, CLSA-2026-1792161765, CLSA-2026-1792161829, CLSA-2026-1792161973, CLSA-2026-1792162033, ECHO-2b2f-5ba5-bff1, GHSA-82fw-gwwq-j7x9, MINI-5pch-36c6-cvh7, MINI-8rxg-g84w-c65f, MINI-c3hj-pmj9-x7x9, MINI-hvp3-872p-jpcc, MINI-mj86-vxfj-vm9m, MINI-phjm-6r4j-r7v3, MINI-xrfm-58hw-j5xm

## What is CVE-2026-84373?

CVE-2026-84373 is a medium-severity path traversal vulnerability in @vitest mocker, published on 1 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Vitest is a testing framework powered by Vite. From 2.1.0 until 4.1.11 and 5.0.0-rc.2, the public mockerPlugin and standalone interceptorPlugin exports in packages/mocker/src/node/interceptorPlugin.ts register the vitest:interceptor:register handler on Vite's unauthenticated HMR WebSocket without validating redirect targets against the file-serving allowlist. The implementation processes event.redirect without enforcing server.fs.allow and server.fs.deny through isFileLoadingAllowed. A remote client that can reach an exposed development server can submit an opaque URL scheme preserving .. segments, causing join(server.config.root, redirectUrl.pathname) to resolve outside the project root. The plugin's load hook then returns readFile(mock.redirect, 'utf-8') as module source, disclosing local files readable by the dev-server process. Vitest browser mode uses a token-authenticated RPC and is not remotely unauthenticated by default, although the same boundary check was missing on that path. This issue is fixed in versions 4.1.11 and 5.0.0-rc.2.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-84373?

8 open source packages ship an affected version, including @vitest/mocker and vitest.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@vitest/mocker` | npm | From 2.1.0 | 4.1.11 |
| `@vitest/mocker` | npm | From 2.1.0 | 4.1.11 |
| `@vitest/mocker` | npm | From 5.0.0-beta.1 | 5.0.0-rc.2 |
| `@vitest/mocker` | npm | From 5.0.0-beta.1 | 5.0.0-rc.2 |
| `vitest` | npm | From 2.1.0 | 4.1.11 |
| `vitest` | npm | From 2.1.0 | 4.1.11 |
| `vitest` | npm | From 5.0.0-beta.1 | 5.0.0-rc.2 |
| `vitest` | npm | From 5.0.0-beta.1 | 5.0.0-rc.2 |

## How do I fix CVE-2026-84373?

Upgrade @vitest/mocker to a fixed version for your release line: 4.1.11 or 5.0.0-rc.2.

## Is CVE-2026-84373 being exploited?

There is no known exploitation of CVE-2026-84373 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-84373 and fix it if it is affected.

What it is: CVE-2026-84373 is a medium-severity path traversal vulnerability in @vitest mocker, published on 1 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-84373 in the wild and no public exploit code.

Affected packages and fixed versions:
- @vitest/mocker (npm): affected from 2.1.0; fixed in 4.1.11
- @vitest/mocker (npm): affected from 2.1.0; fixed in 4.1.11
- @vitest/mocker (npm): affected from 5.0.0-beta.1; fixed in 5.0.0-rc.2
- @vitest/mocker (npm): affected from 5.0.0-beta.1; fixed in 5.0.0-rc.2
- vitest (npm): affected from 2.1.0; fixed in 4.1.11
- vitest (npm): affected from 2.1.0; fixed in 4.1.11
- vitest (npm): affected from 5.0.0-beta.1; fixed in 5.0.0-rc.2
- vitest (npm): affected from 5.0.0-beta.1; fixed in 5.0.0-rc.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-84373/ (Markdown: https://insights.sbomify.com/CVE-2026-84373/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-84373
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-84373
- OSV: https://osv.dev/vulnerability/CVE-2026-84373

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-84373/
Summaries are generated and may contain mistakes; the official description above is the record.
