Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach exposed Vitest dev server
-
ExploitRequest path bypassing server.fs.deny
-
ExecutionRead .vitest-secret-token or .env values
-
ImpactExfiltrate secrets for follow-on access
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK
2 techniques across 2 tactics: Collection, Discovery The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an affected version (Vitest 5.0.0-beta.6 through 5.0.4, incl. @vitest/ui and @vitest/browser) running a Vitest UI, Browser Mode, or API dev server that the attacker can reach over the network - these servers are development-time only and are typically bound to localhost, so the chief limiting factor is whether the server is exposed on a non-loopback interface. The .env-exposure variant additionally requires the victim to be running Browser Mode with test.projects configured and to visit an attacker-controlled website (UI:R), and only exposes JavaScript-compatible .env values. The token/denied-file read targets node_modules/.vitest/.vitest-secret-token and project files that server.fs.deny should have blocked. |
| Impact | This is a medium-severity information-disclosure flaw (CVSS 6.5, CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N) whose real-world priority is modest despite the network attack vector and lack of required privileges. The confidentiality-only impact (I:N/A:N) and the UI:R requirement for the most practical attack path (a malicious website querying a victim's Browser Mode server) both constrain exploitation. Critically, the affected component is a development-time dev server (UI, Browser Mode, or API server) that is not normally exposed to untrusted networks by default, which sharply limits exposure relative to the AV:N rating. No EPSS score was supplied in the input, there is no CISA KEV listing, and no public exploit code was identified - exploitation status is 'no public exploit identified at time of analysis.' The signals are internally consistent: a legitimately network-reachable dev server could leak the fallback API token or fs.deny-protected files, but the dependence on an exposed dev server and/or victim interaction makes this a lower real-world risk than the raw 6.5 suggests. Verify whether any affected dev server is bound to a non-loopback interface in your environment, as that is the determining risk factor. |
| Exploit ScenarioDerived | A developer runs an affected Vitest (5.0.0-beta.6 to 5.0.4) dev server reachable beyond localhost, or uses Browser Mode with test.projects and is lured to a malicious website. The attacker's page (or direct request) reaches the server and retrieves files that server.fs.deny should block - including node_modules/.vitest/.vitest-secret-token or JavaScript-compatible .env values - because project servers replace Vite's default deny matcher and the root server appends the token too late. No public exploit code is known; attack complexity is low once the server is reachable, but the malicious-website path requires user interaction (UI:R). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 20, 2026
Vitest dev servers in versions 5.0.0-beta.6 through 5.0.4 misapply Vite's server.fs.deny denylist, letting remote attackers who can reach a Vitest UI, Browser Mode, or API server read project files that should have been blocked and retrieve the fallback API token stored at node_modules/.vitest/.vitest-secret-token. A second variant, requiring Browser Mode with test.projects and a victim visiting an attacker-controlled site, leaks JavaScript-compatible .env values. No public exploit code or active exploitation has been identified at time of analysis, and the practical exposure is limited because these are development-only servers typically bound to localhost; the fix ships in Vitest 5.0.5.
RemediationAI
Vendor-released patch: upgrade to Vitest 5.0.5 (or later), which is the version referenced in the release tagged https://github.com/vitest-dev/vitest/releases/tag/v5.0.5 and fixes the denylist handling per advisory GHSA-p458-7748-mcp3 and PR https://github.com/vitest-dev/vitest/pull/11578. If you cannot upgrade immediately, keep every Vitest UI, Browser Mode, and API dev server bound to loopback (the default host) and never expose them through port forwarding, reverse proxies, containers with published ports, or remote/cloud dev environments - this removes the network attack surface entirely but breaks legitimate remote-preview workflows. As a second control, explicitly set server.fs.deny to include both Vite's defaults (.env, .env.*, '*.{crt,pem,key,p12,pfx,cer,der}', .npmrc, .yarnrc.yml, '/.git/') and 'node_modules/.vitest/.vitest-secret-token', since any user-supplied list replaces Vite's defaults and omitting the token path leaves it readable. Disabling Browser Mode or removing test.projects from Browser Mode configurations eliminates the cross-site .env leak variant at the cost of losing multi-project browser testing, and rotating/regenerating the .vitest-secret-token after suspected exposure is prudent because a leaked token grants API access to the dev server.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 6 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw lives in how Vitest composes Vite's filesystem-serving restrictions during config resolution. Vite ships a default server.fs.deny list covering .env, .env.*, certificate/private-key extensions (crt, pem, key, p12, pfx, cer, der), .npmrc, .yarnrc.yml and /.git/, but Vite discards those defaults entirely as soon as any explicit value is set. Vitest's per-project (workspace/Browser Mode) servers set their own fs configuration, which silently replaced Vite's defaults, and the root server's attempt to protect the API token was performed by pushing the token filename into server.fs.deny after Vite had already compiled its matcher, so the entry never took effect. The result is CWE-200 exposure of sensitive information: denied files become fetchable, and the fallback API token - which grants access to the Vitest API server - can be read from node_modules/.vitest/.vitest-secret-token, potentially escalating to broader control of the dev server. The upstream fix (PR #11578, commit 28dc1ed) removes the late push, introduces an appendApiTokenFsDeny() helper in packages/vitest/src/node/plugins/utils.ts that explicitly re-adds Vite 8.3's default denylist when the user has not supplied one and always appends API_TOKEN_FILE, and invokes it from both VitestCorePlugin and WorkspaceVitestPlugin inside the config hook. A new end-to-end test (test/e2e/test/fs-deny.test.ts) asserts that root, shared-server, and own-server projects all deny .env, PEM files, and the token file, and that a user-supplied deny list still protects the token.
Know when Vitest gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Network-reachable dev server with no auth (PR:N) and low complexity; UI:R reflects the malicious-website path; confidentiality-only (C:H for token/secret leak, I/A:N).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Vitest is a testing framework powered by Vite. Rated critical severity (CVSS 9.6), this vulnerability is remotely exploi
Vitest is a testing framework powered by Vite. Rated medium severity (CVSS 5.9), this vulnerability is remotely exploita
Path traversal in Vitest Browser Mode (@vitest/browser) lets any client reachable via the Browser Mode API read, create,
Path traversal in Vitest's interceptorPlugin exposes local files on any development server with a network-accessible HMR
A path-traversal information disclosure in Vitest's mocker interceptor plugin requires a Windows host running the Vite d
Vitest development servers running the @vitest/mocker interceptorPlugin can have attacker-controlled JavaScript injected
EUVD-2026-105143
GHSA-p458-7748-mcp3
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB