GHSA-p4f5-76q4-ffq7: Critical Vite Dev Server Bug

4 min read

Updated November 28, 2026: GHSA-p4f5-76q4-ffq7 is a critical Vite dev server bug. The official advisory still lists 8.3.7, 8.2.5, 8.1.7, 7.3.8 and 6.4.6 as the patched versions. On the 8.3 line, 8.3.8 is now the latest release and includes the 8.3.7 security fix, so you can install 8.3.8.

On Tuesday, November 10, the Vite team published a critical security advisory. A bug in the Vite dev server meant that one crafted web request could make it run an attacker's code, or hand over files it was supposed to keep private.

If you build with React, Vue, Svelte, Astro or anything else that runs on Vite, take two minutes to check this today. The good news: most people are only at risk in one specific setup, and the fix is a normal version bump.

The same week, Git shipped Git 2.56.1, a security fix worth doing on your machine and CI.

What happened

The issue is tracked as GHSA-p4f5-76q4-ffq7 on GitHub and is rated Critical.

Inside Vite there are two small internal modules that build their code using part of the URL you request. That part of the URL wasn't escaped. So someone could put their own code into the URL, and Vite would treat it as trusted code.

According to the advisory, that caused two problems:

  • An attacker could pull files from outside your project, which the dev server normally blocks.
  • Because Vite runs some module code through eval for features like new Worker and import.meta.glob, the attacker could get their code to run on the machine running the dev server.

The bug goes back a long way. Every version from Vite 4.0.0 up to the latest 8.3 line is affected, and so is vite-plus up to 1.5.0.

Who is actually at risk

This is the important part. According to the advisory, you're only affected if you explicitly expose the dev server to the network. That means you run vite --host, or you set the server.host option in your config.

If you just run npm run dev and open localhost in your browser, the dev server only listens on your own machine, and this bug isn't reachable from outside.

But exposing the dev server is more common than it sounds. People do it to test a site on their phone over Wi-Fi, to run Vite inside Docker, or to share a preview on a cloud dev box. The SourceCodester developer roundup for November 11 points to exactly those cases. If you're on shared office Wi-Fi, a coffee shop network, or a server with an open port, anyone who can reach that port could try this.

Also worth knowing: this is a dev server bug. Your production build (the files from vite build) isn't the problem. The risk is the machine where the dev server is running, and whatever is on it, like your code, your .env files and your keys.

What to do now

  • Check your version. Run npm ls vite (or the pnpm or yarn equivalent) in each project.
  • Upgrade to a patched version for your line: 8.3.7, 8.2.5, 8.1.7, 7.3.8 or 6.4.6. If you use vite-plus, update to 1.5.1.
  • If you're on Vite 4 or 5, there's no patch listed for those lines. Plan a move to 6.4.6 or newer.
  • Until you've upgraded, stop using --host and remove server.host from your config. Use localhost only.
  • Look at Docker files, dev containers and cloud dev setups. These often expose the dev server by default, so check them even if your laptop is fine.
  • If you exposed a dev server on an untrusted network recently, rotate the keys and secrets that lived on that machine, just to be safe.

My take

This is a good reminder that a dev server is a tool for your own machine, not something to put on a network. Upgrading takes a few minutes, and keeping the dev server on localhost by default protects you from the next bug like this too.

If you'd like a second pair of eyes on your project setup or dependencies, I'm happy to take a look.