How to fix: Vite development client endpoint accessible
The Vite development server HMR (Hot Module Replacement) client is accessible, indicating a development server is running in a production or staging environment.
Why it matters
The Vite dev server is not designed for production use: it lacks security hardening, serves source maps and raw source files, and the HMR WebSocket endpoint accepts arbitrary module hot-replacement payloads. This can enable source code disclosure and code injection.
Vite's development server serves un-bundled source files and exposes HMR endpoints. It should never be deployed to environments accessible from the internet.
How to fix it
- 1Build the production bundle: npm run build
- 2Serve the dist/ directory with a proper web server (nginx, Vercel, Netlify)
- 3Never use vite dev or vite preview in production
- 4Ensure CI/CD deploys the build output, not the dev server
Code examples
Production build and serve
# Build production bundle
npm run build
# Serve with a static server:
npx serve dist -l 3000
# Or Nginx pointing to dist/
# Never: vite dev in productionReferences
Detected automatically by VulnRadar. The check id is vite-client-exposed, stable across every scan so you can filter or diff on it.
More info disclosure checks
- MediumRails Session Cookie Missing HttpOnly Flag
- InfoServer header truncated
- InfoPHP session cookie naming exposes runtime
- Infoconfig.js / settings.js referenced (verify contents)
- Infoenv.js / environment.js referenced (verify contents)
- InfoSitemap.xml publicly accessible
- InfoOpenAPI schema version exposed in URL
- LowCORS exposes internal CDN hostname
Questions
- How severe is Vite development client endpoint accessible?
- VulnRadar rates this high severity in the info disclosure category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id vite-client-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Vite development client endpoint accessible map to?
- It maps to CWE-489. In the OWASP Top 10 it falls under A05:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.