Secrets
An exposed Vite dev server can hand strangers your files and run their code
Cataloged November 19, 2026 · Lovable · Replit · Cursor
Symptom
This applies when a Vite dev server is reachable from other machines. It applies to an older Lovable project you export and run yourself with npm run dev, to a Vite app on Replit whose development URL is public, and to a Vite project you run in Cursor with npm run dev -- --host or with server.host set. If this project does not run the Vite dev server, this card does not apply. GitHub Advisory GHSA-p4f5-76q4-ffq7, "Remote code execution using __vite-browser-external virtual module", is on vitejs/vite. It is rated Critical. It was published on November 10, 2026. The advisory says that by sending an HTTP request to the dev server, arbitrary code execution was possible. It says only apps that explicitly expose the Vite dev server to the network, using --host or the server.host config option, are affected. It says Vite's resolver plugin has __vite-browser-external and __vite-optional-peer-dep virtual modules that embedded the module ID, which comes from the URL, without escaping, so code could be injected. It describes two results. Files the injected code imports are let past the server.fs allow-list check, so a file outside the project, for example a secret file, could be fetched. Vite uses eval to extract values for new Worker and import.meta.glob, so injected code could be run on the server. The advisory says Vite's blocking of some globals is "not a security boundary". The advisory classifies this as CWE-116, Improper Encoding or Escaping of Output. It says the affected vite (npm) versions are >=8.3.0 <=8.3.6, >=8.2.0 <=8.2.4, >=8.0.0 <=8.1.6, >=7.0.0 <=7.3.7, and >=4.0.0 <=6.4.5. The patched releases it names are 8.3.7, 8.2.5, 8.1.7, 7.3.8, and 6.4.6. It says vite-plus (npm) versions <=1.5.0 are affected, and the patched vite-plus release is 1.5.1. It does not list a patched 4.x or 5.x release, so a Vite 4 or 5 project must move to 6.4.6 or later, or stop exposing the dev server. It says Vite 8.3.7 and 8.2.5 rely on the fix in Rolldown 1.2.17, and Vite 8.1.7 relies on the fix in Rolldown 1.1.7. The Vite v8.3.7 release, published November 9, 2026, says "deps: update Rolldown to v1.2.18". The Vite docs page "Server Options" says the server.host default is 'localhost'. It says to set server.host to 0.0.0.0 or true to listen on all addresses, including LAN and public addresses, and that the CLI flag is --host. It says that if server.allowedHosts is true, the server responds to requests for any host. The DANGER box on that page says setting allowedHosts to true "allows any website to send requests to your dev server through DNS rebinding attacks, allowing them to download your source code and content", and it recommends an explicit list. That box points to GHSA-vg6x-rcgg-rjx6. Older Lovable projects use React and Vite. The public Lovable-generated repository bsctl/lovable sets server: { host: "::", port: 8080 } in vite.config.ts. Its package.json has "vite": "^5.4.1". The host "::" means listen on every IPv6 address, and on most systems on IPv4 too. That is a server.host setting that exposes the dev server beyond localhost. It matters when you run npm run dev for an exported Lovable project on your own computer or a server, because other devices on the same network can reach it. This card does not describe Lovable's hosted preview or a site published by Lovable. Replit's docs page "Development URLs" says development URLs (UUID.servername.replit.dev) are private by default and require authentication. It says turning off "Private preview" in Networking makes the development URL public so anyone with the URL can view the running app. Replit's docs page "Ports" says a process listening on 0.0.0.0 listens on every network interface, and that Replit exposes it through an external port. Vite apps on Replit commonly set server.host to "0.0.0.0" and allowedHosts to true so the webview works. A Replit community thread shows the fix "Add allowedHosts: true to the vite.ts for the server config". The Replit case on this card is a Vite dev server on a development URL that is public because Private preview is off. For a Vite project you run in Cursor, on your own machine, VM, or container, the advisory and the Server Options page are the sources: npm run dev -- --host, or server.host set, exposes the dev server the same way. A site built with vite build and served as static files does not run the Vite dev server. That sentence is an inference. The advisory is about the dev server. It does not mention vite build.
Root cause
When the Vite dev server is reachable from other machines, a crafted request could slip code into a module Vite trusts, letting the attacker read files the dev server should refuse, such as a secret file, and run code on the machine running npm run dev. GitHub Advisory GHSA-p4f5-76q4-ffq7 says that by sending an HTTP request to the dev server, arbitrary code execution was possible. It says only apps that explicitly expose the Vite dev server to the network, using --host or the server.host config option, are affected. It says Vite's resolver plugin has __vite-browser-external and __vite-optional-peer-dep virtual modules that embedded the module ID, which comes from the URL, without escaping, so code could be injected. Files the injected code imports are let past the server.fs allow-list check, so a file outside the project, for example a secret file, could be fetched. Vite uses eval to extract values for new Worker and import.meta.glob, so injected code could be run on the server. The advisory says Vite's blocking of some globals is "not a security boundary". The advisory classifies this as CWE-116, Improper Encoding or Escaping of Output. The Vite docs page "Server Options" says the server.host default is 'localhost'. It says setting server.host to 0.0.0.0 or true, or passing the CLI flag --host, listens on all addresses, including LAN and public addresses. The DANGER box on that page is a separate warning from this advisory. It says setting allowedHosts to true "allows any website to send requests to your dev server through DNS rebinding attacks, allowing them to download your source code and content", and it recommends an explicit list. That box points to GHSA-vg6x-rcgg-rjx6.
Before and after
The dev server only answers your own machine, and the version is a patched one per GHSA-p4f5-76q4-ffq7. The before block is the server setting from a public Lovable-generated vite.config.ts, server: { host: "::", port: 8080 }, plus the "vite": "^5.4.1" line from that repository's package.json. ^5.4.1 is an example version inside the affected range >=4.0.0 <=6.4.5 from GitHub Advisory GHSA-p4f5-76q4-ffq7. The advisory does not name 5.4.1, and it does not list a patched 5.x release. The host "::" listens on every IPv6 address, and on most systems on IPv4 too, so it is a server.host value that exposes the dev server beyond localhost. The after block sets vite to 6.4.6, the patched release that advisory names for the >=4.0.0 <=6.4.5 line. It does not show 7.3.8 or 8.3.7. Those are the patched releases the advisory names for the 7.x line and the 8.3 line. The after block sets server.host to "localhost", which the Vite docs page "Server Options" says is the default, and it keeps port 8080 from the Lovable file. That page does not mention port 8080. allowedHosts is an explicit list, not true. That page's DANGER box says setting allowedHosts to true allows any website to send requests to your dev server through DNS rebinding attacks, allowing them to download your source code and content, and it recommends an explicit list. The page does not print the array ["localhost"]. localhost in that array is the default host that page names. This after block is the case where the dev server does not need to be reachable from other machines. This pair does not show a request.
Before
"vite": "^5.4.1"
server: { host: "::", port: 8080 }After
"vite": "6.4.6"
server: {
host: "localhost",
port: 8080,
allowedHosts: ["localhost"],
}Fix prompt
In this project only. Do not scan or test anyone else's app. Do not open a dev server you do not own. Do not print keys, tokens, passwords, file contents, or environment variable values. When you mention a variable, print the name only. Do not send a test request to any server, including this project's own dev server, that uses the injection described in GitHub Advisory GHSA-p4f5-76q4-ffq7. Do not print a request that would do that.
1. This prompt applies if this project depends on vite or vite-plus. If it does not, say so and stop.
2. In this project only, run npm ls vite. If vite-plus is a dependency, also run npm ls vite-plus. GitHub Advisory GHSA-p4f5-76q4-ffq7 says the affected vite (npm) versions are >=8.3.0 <=8.3.6, >=8.2.0 <=8.2.4, >=8.0.0 <=8.1.6, >=7.0.0 <=7.3.7, and >=4.0.0 <=6.4.5. The patched releases it names are 8.3.7, 8.2.5, 8.1.7, 7.3.8, and 6.4.6. It says vite-plus (npm) versions <=1.5.0 are affected, and the patched vite-plus release is 1.5.1. It does not list a patched 4.x or 5.x release. Report the version npm ls actually prints. Do not guess a version you did not read. If the installed version is not in an affected range, say so and do not change it in the next step.
3. If the installed vite version is in an affected range, upgrade it to the patched release for that line. For >=8.3.0 <=8.3.6, install 8.3.7. For >=8.2.0 <=8.2.4, install 8.2.5. For >=8.0.0 <=8.1.6, install 8.1.7. For >=7.0.0 <=7.3.7, install 7.3.8. For >=4.0.0 <=6.4.5, including Vite 4 and Vite 5, install 6.4.6 or later. The advisory does not list a patched 4.x or 5.x release. If vite-plus is installed and the version is <=1.5.0, install 1.5.1. Do not upgrade unrelated packages. Do not add a direct Rolldown dependency this project does not already have. The advisory says Vite 8.3.7 and 8.2.5 rely on the fix in Rolldown 1.2.17, and Vite 8.1.7 relies on the fix in Rolldown 1.1.7. The Vite v8.3.7 release says "deps: update Rolldown to v1.2.18". Upgrading vite to the patched release is the step. Write the version you actually install. Show me the package.json diff only if you change a version.
4. Find server.host in this project's vite.config.ts, vite.config.js, vite.config.mjs, and any vite.ts server config. Find --host in package.json scripts, in .replit, and in Dockerfiles in this project. Give the file and the line. The Vite docs page "Server Options" says the server.host default is 'localhost'. It says setting server.host to 0.0.0.0 or true, or passing --host, listens on all addresses, including LAN and public addresses. The advisory says only apps that explicitly expose the dev server that way are affected. A public Lovable-generated vite.config.ts sets server: { host: "::", port: 8080 }. The host "::" means listen on every IPv6 address, and on most systems on IPv4 too. Do not print file contents beyond the host setting. Do not print env values.
5. If this project does not truly need the dev server on the network, remove server.host or set it to "localhost", and remove --host from scripts, .replit, and Dockerfiles. The Server Options page says 'localhost' is the default. Show me the diff.
6. If this project does need the dev server on the network, keep that host setting and say why you kept it. A Replit webview and a container that must be reached from outside the process are the cases this card means. On Replit, do not turn Private preview off. Replit's docs page "Development URLs" says development URLs are private by default and require authentication, and that turning off "Private preview" in Networking makes the development URL public so anyone with the URL can view the running app. Tell me to leave Private preview on. Do not change Replit settings yourself. Replit's docs page "Ports" says a process listening on 0.0.0.0 listens on every network interface, and that Replit exposes it through an external port. Show me the diff only if you change a host setting.
7. If allowedHosts is true, replace it with an explicit list of the hosts this project already uses. Never set allowedHosts to true. The Server Options page says that if server.allowedHosts is true, the server responds to requests for any host. Its DANGER box says setting allowedHosts to true "allows any website to send requests to your dev server through DNS rebinding attacks, allowing them to download your source code and content", and it recommends an explicit list. That box points to GHSA-vg6x-rcgg-rjx6. A Replit community thread shows the words "Add allowedHosts: true to the vite.ts for the server config". Do not apply that line as written. Use an explicit list, as the Vite docs recommend. Do not invent hostnames. If you cannot tell which hosts this project already names, stop and ask me. Show me the diff only if you change allowedHosts.
8. Do not run the Vite dev server as the production server. Publish a build. The advisory is about the dev server. A site built with vite build and served as static files does not run the Vite dev server. That sentence is an inference. The advisory does not mention vite build. Do not add a production command that runs the Vite dev server. If this project already serves a vite build, say so and do not change that command.
9. Show me the diffs. Do not send a request. Do not print secrets. Tell me to run npm ls vite in this project and compare it with the patched releases the advisory names. Tell me that opening my own dev URL from another device I own is a reachability check only, not the advisory's request.
Do not print keys. Do not edit unrelated files.Paste this into the coding tool that has your own project open.
2-minute self-check
These steps are for an app you own. Do not run them against someone else's project.
- In your own project, run npm ls vite. If vite-plus is installed, run npm ls vite-plus. Compare the printed version with GitHub Advisory GHSA-p4f5-76q4-ffq7. That advisory says the affected vite versions are >=8.3.0 <=8.3.6, >=8.2.0 <=8.2.4, >=8.0.0 <=8.1.6, >=7.0.0 <=7.3.7, and >=4.0.0 <=6.4.5. The patched releases it names are 8.3.7, 8.2.5, 8.1.7, 7.3.8, and 6.4.6. It says vite-plus <=1.5.0 is patched in 1.5.1. It does not list a patched 4.x or 5.x release. Do not run this in a project you do not own.
- In your own project, open vite.config.ts, vite.config.js, or vite.config.mjs, and open package.json. Look for server.host, for --host in scripts, and for allowedHosts set to true. If this project has a .replit file or a Dockerfile, look there for --host too. The Vite docs page "Server Options" says the default server.host is 'localhost', and that 0.0.0.0, true, or --host listens on all addresses, including LAN and public addresses. Its DANGER box says setting allowedHosts to true allows any website to send requests to your dev server through DNS rebinding attacks, allowing them to download your source code and content. Do not open a repository you do not own.
- If this project runs on Replit, open Networking and confirm Private preview is on. Replit's docs page "Development URLs" says development URLs are private by default and require authentication, and that turning off "Private preview" makes the development URL public so anyone with the URL can view the running app. With your own dev server running, from another device on your network, try to open your own dev URL. If that URL is already public, try from your phone with Wi-Fi off. If the page loads and you did not mean other devices to reach it, stop the server and apply the fix. Open the page only. Do not send the HTTP request the advisory describes. Do not point this at a server you do not own.
Common questions
My published app is a static build. Am I affected?
The advisory is about the dev server. GitHub Advisory GHSA-p4f5-76q4-ffq7 says that by sending an HTTP request to the dev server, arbitrary code execution was possible. It says only apps that explicitly expose the Vite dev server to the network, using --host or the server.host config option, are affected. A site built with vite build and served as static files does not run the Vite dev server. That sentence is an inference. The advisory does not mention vite build, and it does not say a static build is unaffected. If you still run npm run dev on a machine other people can reach, that dev server is the case the advisory describes, even when the site you publish is static files.
I'm on Vite 5. Is there a patch?
No patched 5.x release is listed. GitHub Advisory GHSA-p4f5-76q4-ffq7 says one affected range is vite >=4.0.0 <=6.4.5, and the patched release it names for that range is 6.4.6. It does not list a patched 4.x or 5.x release. Move to 6.4.6 or later, or stop exposing the dev server. The public Lovable-generated repository bsctl/lovable has "vite": "^5.4.1" in package.json. That is an example version inside the affected range >=4.0.0 <=6.4.5. The advisory does not name 5.4.1.
Replit needs host 0.0.0.0 for the preview. What do I do?
Upgrade Vite to the patched release for your line, keep Private preview on, and use an explicit allowedHosts list rather than true. GitHub Advisory GHSA-p4f5-76q4-ffq7 names the patched vite releases 8.3.7, 8.2.5, 8.1.7, 7.3.8, and 6.4.6. It names vite-plus 1.5.1 for vite-plus <=1.5.0. Replit's docs page "Development URLs" says development URLs are private by default and require authentication, and that turning off "Private preview" in Networking makes the development URL public so anyone with the URL can view the running app. Replit's docs page "Ports" says a process listening on 0.0.0.0 listens on every network interface, and that Replit exposes it through an external port. A Replit community thread shows the words "Add allowedHosts: true to the vite.ts for the server config". The Vite docs page "Server Options" says that if server.allowedHosts is true, the server responds to requests for any host. The DANGER box on that page says setting allowedHosts to true "allows any website to send requests to your dev server through DNS rebinding attacks, allowing them to download your source code and content", and it recommends an explicit list. Do not set allowedHosts to true.
Sources
- GitHub Advisory GHSA-p4f5-76q4-ffq7: Remote code execution using `__vite-browser-external` virtual module
- Vite v8.3.7 release
- Vite docs: Server Options
- Public Lovable-generated vite.config.ts (bsctl/lovable)
- Public Lovable-generated package.json (bsctl/lovable)
- Replit docs: Development URLs
- Replit docs: Ports
- Replit community thread: Add allowedHosts: true to the vite.ts for the server config