Skip to main content

Vitest CVE-2026-112948

| EUVDEUVD-2026-105143 MEDIUM
Information Exposure (CWE-200)
2026-10-20 GitHub_M GHSA-p458-7748-mcp3
6.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach exposed Vitest dev server
  2. Exploit
    Request path bypassing server.fs.deny
  3. Execution
    Read .vitest-secret-token or .env values
  4. Impact
    Exfiltrate 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).

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

vite-plus 1.0.0-rc.0, < 1.3.0
Browser 5.0.0-beta.6, < 5.0.5
ui 5.0.0-beta.6, < 5.0.5
vitest 5.0.0-beta.6, < 5.0.5

Affected Packages

npm @vitest/browser fix: 5.0.5
npm @vitest/ui fix: 5.0.5
npm vite-plus fix: 1.3.0
euvd browser fix: 5.0.5
euvd ui fix: 5.0.5
euvd vitest fix: 5.0.5

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

Vendor (GitHub_M) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
vuln.today AI 6.5 MEDIUM

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).

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch available
Oct 20, 2026 - 17:18 EUVD
CVE Published
Oct 20, 2026 - 15:15 cve.org
MEDIUM 6.5

DescriptionCVE.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

EPSS Score
0.4%
Top 66% exploitable
Prevalence
High
extremely popular JavaScript test framework, but dev-time-only component
Threat Intel
1
1 sources
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy