Vite: `server.fs.deny` bypass on Windows alternate paths
vitejs vite
vitejs vite
|
Vite is a frontend tooling framework for JavaScript. Prior to 8.0.16, 7.3.5, and 6.4.3, the contents of files that are specified by server.fs.deny can be returned to the browser on Windows. Vite’s dev server denies direct access to sensitive files through server.fs.deny, including entries such as .env, .env.*, and *.{crt,pem}. However, on Windows, the deny logic does not correctly normalize NTFS ADS path forms before access checks are applied. Because of this, requests such as /.env::$DATA?raw are treated as allowed paths, while Windows resolves them to the original file's default data stream. Similar to that, Windows allows accessing a file using a different name with the 8.3 short name compatibility feature. Vite did not reject accessing files via them. This vulnerability is fixed in 8.0.16, 7.3.5, and 6.4.3.
From the CVE record · GitHub_M
On Windows, Vite’s dev server can return files blocked by server.fs.deny because some Windows path forms bypass its access checks. An attacker who can send requests to the dev server may read those files; the input does not specify authentication requirements or user interaction.
Check Windows dev servers using npm vite versions >=8.0.0 <8.0.16, >=7.0.0 <7.3.5, or <6.4.3, or npm vite-plus versions <0.1.24.