Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file (vitest-dev vitest)

CVE-2026-112948
MEDIUM 6.5

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

VersionScoreVectorScored by
CVSS 3.1MEDIUM 6.5CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:NGitHub_M
CVSS 3.1MEDIUM 6.5CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:NNVD · security-advisories@github.com (Secondary)

Advisories

European references

Affected products

ProductAffected 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

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD