GHSA-v2wj-q39q-566rHigh

Vite: `server.fs.deny` bypassed with queries

Published
April 6, 2026
Last Modified
April 7, 2026

🔗 CVE IDs covered (1)

📋 Description

Summary

The contents of files that are specified by server.fs.deny can be returned to the browser.

Impact

Only apps that match the following conditions are affected:

Details

On the Vite dev server, files that should be blocked by server.fs.deny (e.g., .env, *.crt) can be retrieved with HTTP 200 responses when query parameters such as ?raw, ?import&raw, or ?import&url&inline are appended.

PoC

  1. Start the dev server: pnpm exec vite root --host 127.0.0.1 --port 5175 --strictPort
  2. Confirm that server.fs.deny is enforced (expect 403): curl -i http://127.0.0.1:5175/src/.env | head -n 20
  3. Confirm that the same files can be retrieved with query parameters (expect 200):

🎯 Affected products2

  • npm/vite:>= 8.0.0, <= 8.0.4
  • npm/vite:>= 7.1.0, <= 7.3.1

🔗 References (7)