Vite's Critical Dev Server Flaw: Check Your Version and --host

Vite's November advisory lets a crafted request run code on exposed dev servers. How to check your version and --host settings, which release fixes each line, and how to force it.

Ananya RaoAnanya RaoAuthor5 December 20264 min read 3 views

Researched and drafted with AI and reviewed by the Publisha team.

Vite's Critical Dev Server Flaw: Check Your Version and --host
In this article▾
  1. Am I affected? Two questions
  2. 1. Which Vite version do I have?
  3. 2. Is my dev server exposed?
  4. How the bug worked, in plain terms
  5. Upgrading, including when a framework pins Vite
  6. Habits worth keeping after you've patched
  7. The short version

On 10 November 2026, Vite published a critical security advisory: a crafted HTTP request to the Vite dev server could lead to arbitrary code execution on the machine running it. The catch that decides whether you need to drop everything is in the advisory's impact section. Only dev servers explicitly exposed to the network, with --host or the server.host config option, are affected. If you run vite on your laptop with defaults, you're not exposed through this bug, but you should still upgrade. If you run Vite inside Docker, on a remote dev box, or with --host so you can test on your phone, upgrade today. Checking takes two commands, and fixing it usually takes one.

Am I affected? Two questions

1. Which Vite version do I have?

Run this in each project. It shows every copy of Vite in the dependency tree, including ones pulled in by frameworks and tools:

npm ls vite

The advisory, GHSA-p4f5-76q4-ffq7, lists these affected ranges and fixes:

  • 8.3.0 to 8.3.6: fixed in 8.3.7. The current release, 8.3.8, came out on 11 November.

  • 8.2.0 to 8.2.4: the advisory names 8.2.5, but on the npm registry the 8.2-line release published with the other fixes on 9 November is 8.2.6. There is no 8.2.5 to install.

  • 8.0.0 to 8.1.6: fixed in 8.1.7.

  • 7.0.0 to 7.3.7: fixed in 7.3.8.

  • 4.0.0 to 6.4.5: fixed in 6.4.6.

  • vite-plus 1.5.0 and earlier: fixed in 1.5.1.

Read the second-to-last line carefully. If you're still on Vite 4 or 5, there's no patch on your major version. The fix for that whole range is 6.4.6, which means a major upgrade. Until you do it, the only mitigation is not exposing the dev server.

2. Is my dev server exposed?

Per the Vite server options docs, server.host defaults to 'localhost'. Setting it to 0.0.0.0 or true, or passing --host on the command line, makes Vite listen on all addresses, "including LAN and public addresses". Search for both:

grep -n -- "--host" package.json
grep -n "host" vite.config.*

Typical places this turns up: a dev script with --host so teammates or phones on the office Wi-Fi can open the app, a Dockerfile or compose file that runs the dev server inside a container, and cloud or remote development machines. Each of those is an exposed server.

How the bug worked, in plain terms

Vite's resolver uses two internal "virtual modules", __vite-browser-external: and __vite-optional-peer-dep:, each followed by a suffix. The advisory explains that Vite built the code for these modules from a module ID derived from the request URL, without escaping it. Because the suffix could be anything, a request could inject code into the generated module.

Vite trusts its own generated modules, which caused two problems:

  • File disclosure. Files imported by a trusted module are allowed past Vite's server.fs checks. Injecting an import of a file outside your project made Vite willing to serve it.

  • Code execution. Vite uses eval to extract values from module code for new Worker and import.meta.glob. Injected code reaching that path ran on the server. Vite blocks some globals there, but as the advisory notes, that isn't a security boundary.

The lesson generalises beyond Vite: any time a URL fragment ends up inside generated source code, it needs escaping as strictly as user input inside SQL. The advisory classifies it as CWE-116, improper encoding or escaping of output. For Vite 8, the vulnerable code lives in the Rolldown binary that Vite uses, and the fixed Vite versions depend on fixed Rolldown releases.

Upgrading, including when a framework pins Vite

If Vite is a direct dependency, upgrade within your major version:

npm install --save-dev vite@8.3.8

Swap in vite@7.3.8 or vite@6.4.6 if you're on those lines. Then run npm ls vite again and check that no older copy remains.

If a framework or tool brings in its own Vite and hasn't released an update yet, npm's overrides field in package.json forces the version across the tree:

{
  "overrides": {
    "vite": "8.3.8"
  }
}

npm's documentation notes that overrides are only read from your project's root package.json, so put it there, not in a workspace package. Use overrides as a stopgap, not a permanent setting. A framework that expects a different Vite major can break in subtle ways, so run your dev server and build before you commit, and remove the override once the framework ships its own update.

Habits worth keeping after you've patched

  • Only use --host when you need it. Make it a separate script, such as dev:lan, rather than the default dev command.

  • Bind to one address when you can. server.host accepts a specific IP, so a container can listen on its internal network instead of every interface.

  • Never put a dev server on the public internet. If a client needs a preview, deploy a build to a preview environment.

  • Watch advisories for your toolchain, not just your runtime. Dev tools run with your user's permissions and can read your SSH keys and .env files. They deserve the same patch discipline as the Node.js November security release.

Check this alongside your other framework updates. If you're also on Next.js, the approach in this earlier guide to working out which Next.js security release you need applies to its newer patches too.

The short version

Run npm ls vite. If you're below 8.3.7, 8.2.6, 8.1.7, 7.3.8 or 6.4.6, upgrade. If you're on Vite 4 or 5, plan the move to 6.4.6 or later, and stop exposing the dev server until you do. And if any script, container or config uses --host, treat this as today's job rather than this sprint's.

Ananya Rao

Written by

Ananya Rao

A Publisha editorial profile. Its stories are researched and drafted with AI and reviewed by the Publisha team.

Keep reading

More from Ananya Rao

More from Ananya Rao

More in Web Development

Have a story of your own?

Publisha is free to start. Write with AI that keeps your voice, and publish in a click.