Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @vitest/browser
  4. ›
  5. CVE-2026-112948

CVE-2026-112948: Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file

October 21, 2026

In Vitest 5, Vite’s server.fs.deny is not applied as intended on Vitest’s dev servers. Depending on the server, files that Vite refuses to serve by default (such as .env, private keys and certificates, .npmrc, and .git) or Vitest’s own API token file (.vitest-secret-token) can be read over plain HTTP by a client that can reach the server. In Browser Mode with test.projects, a malicious website can also read .env values through the developer’s browser.

This only applies when Vitest runs an HTTP server, which happens with the UI (--ui), Browser Mode, or api enabled. Plain vitest and vitest run don’t listen on any port and are not affected. The fix ships in vitest, and @vitest/ui and @vitest/browser are listed because they are what enables the affected setups. Both pin vitest to the same version as a peer dependency, so upgrading either one also requires the patched vitest. Users who enable api without @vitest/ui or @vitest/browser are also affected and should upgrade vitest.

References

  • github.com/advisories/GHSA-p458-7748-mcp3
  • github.com/vitest-dev/vitest/commit/28dc1edfb6ba5a181fe208576989063795aeadb3
  • github.com/vitest-dev/vitest/pull/11578
  • github.com/vitest-dev/vitest/releases/tag/v5.0.5
  • github.com/vitest-dev/vitest/security/advisories/GHSA-p458-7748-mcp3
  • nvd.nist.gov/vuln/detail/CVE-2026-112948

Code Behaviors & Features

Detect and mitigate CVE-2026-112948 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 5.0.0-beta.6 before 5.0.5

Fixed versions

  • 5.0.5

Solution

Upgrade to version 5.0.5 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-552: Files or Directories Accessible to External Parties

Source file

npm/@vitest/browser/CVE-2026-112948.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Thu, 22 Oct 2026 00:15:47 +0000.