You want a client to open the work-in-progress on their phone, so you run vite --host and send them the IP link. Everyone does it. What you also did was let every machine on that network talk to a dev server that reads files off your disk, and over the last two years a steady stream of advisories showed server.fs.deny could be walked around. Vite 8.4, released on 26 November 2026, starts flipping that model: instead of guessing which files are dangerous, it can serve only the files your project actually references.
This is not a patch you install and forget. It is a default the Vite team says will change in the next major. Turning it on now means you find the broken parts on a day you picked.
What Vite 8.4 changes in your config
The big one is a new mode for server.fs that limits the dev server to files reachable from the entrypoint. The rest is small stuff you'll hit while running dev, plus two renamed options.
From the Vite 8.4 announcement and the 8.4.0 changelog:
server.fs.strict: 'extended'extends the access checks to modules loaded by plugins, and paired withserver.fs.allow: []it switches you to an allow-list.- Plugins can call
this.environment.addSafeModuleto mark a file they generate as safe. - Starting a second dev server for the same project now fails with the port and PID of the one already running.
- CSS for a dynamic chunk is re-fetched when the import runs again after a failure.
url()in CSS resolves subpath imports.css.devSourcemapmoved todev.sourcemap.css, and--configLoader=runneris deprecated.
Why move from a deny list to an allow-list
Because a deny list keeps losing. The default server.fs.deny is ['.env', '.env.*', '*.{crt,pem,key,p12,pfx,cer,der}', '.npmrc', '.yarnrc.yml', '**/.git/**'] per the server options docs, which covers the files everyone thinks of. The bypasses that land are the ones nobody thought of.
The clearest example is CVE-2025-30208 (GHSA-x574-m823-4x7w, published 24 March 2025, CVSS 3.1 score 5.3). Appending ?raw?? to a URL returned the contents of files outside the allow list, because Vite stripped trailing ? characters in one place while the query-string regexes didn't account for them. It was fixed in 6.2.3, 6.1.2, 6.0.12, 5.4.15 and 4.5.10, and more variants followed: an ?import&?inline=1.wasm?init suffix, a # fragment trick, a Windows backslash trick.
Same root cause every time. One path string gets interpreted slightly differently by each layer that looks at it, so any rule shaped like "block this pattern" eventually has a gap. "Does the project reference this file?" is a much easier question to answer, and much harder to get subtly wrong.
Worth repeating: this class of bug only matters when the dev server is reachable from the network via --host or server.host. Which is exactly the moment you send that link to a client.
How to turn the allow-list on
Add this to vite.config.ts and run dev as usual:
export default {
server: {
fs: {
strict: 'extended',
allow: [],
},
},
}With an empty allow array, Vite stops auto-detecting a workspace root and serves only files referenced from the entrypoint, including transitive references.
Then:
- Click through every route, especially ones that load assets dynamically or read files from outside the project root.
- Watch the network tab for 403s. For each one, first ask whether that file should have been imported properly in the first place.
- If a plugin generates a module that points at an asset without an
import, the fix belongs in the plugin:addSafeModule, not a path added to yourallowlist. - In a monorepo that genuinely reads assets across packages, allow those specific paths. Don't allow the repo root.
If the project is a big monorepo or plugin-heavy, don't bundle this change into the same pull request as the version bump. Splitting it into reviewable layers makes the broken piece obvious, which is the whole argument in our post on stacked pull requests.
The smaller 8.4 changes you'll notice first
Three things show up within a day: the dev server lock, CSS re-fetching, and two renamed options.
You can't start dev twice. If a dev process for this project is already running, Vite exits and tells you where it is. If you run several on purpose, say e2e alongside dev, --bypass-lock skips the check.
Dynamic import CSS can recover. The familiar version of this bug: the network hiccups on a route's first load, the user retries, the JS arrives from cache and the styles never do. Vite 8.4 updates the preload helper to re-fetch the CSS, which depends on the browsers that implement the newer spec behaviour: Chrome 156+, Firefox 155+, and Safari Technology Preview 252.
Two options moved. css.devSourcemap is now dev.sourcemap.css, and --configLoader is stable with runner deprecated. The old names still work, but renaming them during the upgrade saves you a warning you'll otherwise ignore for a year.
Should you touch bundled dev mode for SSR?
Not on client work yet. The announcement calls it "highly experimental" and describes it as groundwork for meta-frameworks, with more to come.
It matters if your app is big enough that a cold dev start is a coffee break. If dev comes up in two or three seconds, moving onto a mode that still shifts between releases costs more than it returns. Wait until the meta-framework you use supports it.
So, upgrade or wait?
Upgrade. 8.4 is a minor with no hard breaking changes and a long list of fixes, plus real build wins: import-analysis hooks skipped for unaffected chunks, the terser plugin skipped when you don't use terser, native process start-time lookup on Windows.
The allow-list is the part that needs judgement. Turn it on where a team still owns the code and has sprint time to fix what falls out, not on a project you handed over and nobody maintains. What you get back is an honest list of what your dev server actually serves, and it's usually longer than anyone on the team expected.
Everything else is the old discipline: don't expose the dev server to the internet. Give clients a preview build or a staging URL behind auth. We write about this kind of thing regularly in web development.
Upgrading Vite and stuck on config or your build pipeline? Talk to our team and we'll help you work out what to fix first.
Talk to our team



