Your dev server may be handing out files your app never uses. Vite 8.4, released on November 26, adds a stricter way to stop that. The catch is that you have to turn it on.
What changed
Vite has a file-serve check, server.fs, that stops a dev server from serving files when a bad actor can reach it. It first appeared in Vite 2.7 and relied on a block-list: you and Vite listed the sensitive files, per the Vite 8.4 announcement. The Vite team says it kept having to patch bypasses that abuse quirks of the file system and HTTP parsing, and that attacks are increasing, per the Vite 8.4 announcement. So Vite 8.4 adds an allow-list check. Setting server.fs.strict: 'extended' applies the check to modules loaded by plugins too. Vite also now tracks referenced modules not just from import but from other places such as CSS url(), per the Vite 8.4 announcement. Combine it with server.fs.allow: [] and only files referenced from the entry point, including indirect references, can be served, per the Vite 8.4 announcement. The team says it intends to make this the default in the next major version.
