Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file (vitest-dev vitest)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.40 % · percentile 36 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- GitHub_M
- Affected products
- vitest-dev · vitest
@vitest · browser
@vitest · ui
vitejs · vite-plus - NVD status
- Awaiting Analysis
Description
Vitest is a testing framework powered by Vite. From 5.0.0-beta.6 until 5.0.5, Vitest dev servers can misapply server.fs.deny because project servers replace Vite's defaults and the root server adds .vitest-secret-token after Vite compiles its matcher. An attacker who can reach an affected UI, Browser Mode, or API server can read denied project files or the fallback API token at node_modules/.vitest/.vitest-secret-token, and Browser Mode with test.projects can expose JavaScript-compatible .env values through a malicious website. This issue is fixed in version 5.0.5.
Weaknesses (CWE)
- CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor
- CWE-552 — Files or Directories Accessible to External Parties
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N | GitHub_M |
| CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N | NVD · security-advisories@github.com (Secondary) |
Advisories
- GHSA-p458-7748-mcp3 — Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file
European references
- ENISA EUVD · EUVD-2026-105143
- GCVE · GCVE-0-2026-112948
Affected products
| Product | Affected versions |
|---|---|
| vitest-dev · vitest | affected : >= 5.0.0-beta.6, < 5.0.5 |
| @vitest · browser | affected : >= 5.0.0-beta.6, < 5.0.5 |
| @vitest · ui | affected : >= 5.0.0-beta.6, < 5.0.5 |
| vitejs · vite-plus | affected : >= 1.0.0-rc.0, < 1.3.0 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |