llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · vite

GHSA-RQ7H-C2JC-7F22

Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine

Parche disponible
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche6 versionesPrimer parche a -15 d de la divulgación
Exposición28 dDesde la divulgación, 21 oct 2026, 11:47 a. m.
Detección26 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Parche 6.4.4 +4
Parche 1.1.0
Monitoreo
Detectada
6 oct 26
7 oct 26
21 oct 26
17 nov 26
19 nov 26
6 oct 26
17 oct 26
28 oct 26
8 nov 26
19 nov 26
FechaFaseEventoDetalle
Remediación Parche 6.4.4 vite · -15 d desde divulgación
Remediación Parche 7.3.7 vite · -15 d desde divulgación
Remediación Parche 8.1.6 vite · -15 d desde divulgación
Remediación Parche 8.2.4 vite · -15 d desde divulgación
Remediación Parche 8.3.3 vite · -15 d desde divulgación
Remediación Parche 1.1.0 vite-plus · -14 d desde divulgación
Divulgación Publicada GHSA-RQ7H-C2JC-7F22 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

The content of files outside `server.fs` setting can be returned to the browser if the project imports a file path concatenated with the `root`. For example, if the project references `<path-to-project-root>/etc/hosts`, the content of `/etc/hosts` was possible to be returned.

The content of files outside the `server.fs.allow` option can be returned to the browser when a project imports a file whose root-relative path matches an absolute path on the host. For example, referencing `<project-root>/etc/hosts` could make Vite return the host's `/etc/hosts` file.

Impact

Only apps that meet all of the following conditions are affected:

  • explicitly expose the Vite dev server to the network (using `--host` or the `server.host` option https://vite.dev/config/server-options#server-host)
  • contain an imported file whose root-relative browser URL is also the absolute path of a readable file on the host
  • The sensitive file is not matched by `server.fs.deny` https://vite.dev/config/server-options#server-fs-deny
  • the dev server is not running on Windows
Details

When Vite analyzes an in-root import, it rewrites the resolved module ID to a browser URL such as `/etc/hostname`. In affected versions, Vite converts that URL with `fsPathFromUrl` and adds the result to `safeModulePaths`. Because `fsPathFromUrl` ensures a leading slash without resolving the URL against the project root, the project URL `/etc/hostname` is recorded as if it were the absolute filesystem path `/etc/hostname`.

For a later request to `/@fs/etc/hostname`, the raw-filesystem middleware interprets `/etc/hostname` as an absolute path. The access check applies `server.fs.deny`, then accepts paths present in `safeModulePaths` before checking `server.fs.allow`. As a result, the request can return the host file instead of the project file that originally populated `safeModulePaths`.

### PoC
The following example requires Linux with a readable `/etc/hostname`:

$ mkdir vite-safe-module-path-poc
$ cd vite-safe-module-path-poc
$ npm init -y
$ npm install vite@8.3.1
$ mkdir -p etc
$ echo 'PROJECT-DECOY\n' > etc/hostname
$ echo 'import "./etc/hostname"\n' > main.js
$ npx vite --host 127.0.0.1

In another terminal:

$ curl -o /dev/null -s -w '%{http_code}\n' http://127.0.0.1:5173/main.js
200
$ curl -sS -o response -w '%{http_code}\n' http://127.0.0.1:5173/@fs/etc/hostname
200
$ cmp -s response /etc/hostname && echo 'response matches host file'
response matches host file

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

Versiones

Rangos afectados

Afectada Corregida Última
vite-plus< 1.1.0
vite< 6.4.4
vite≥ 7.0.0 < 7.3.7
vite≥ 8.0.0 < 8.1.6
vite≥ 8.2.0 < 8.2.4
vite≥ 8.3.0 < 8.3.3
1.1.0
1.6.0
6.4.4
7.0.0
7.3.7
8.0.0
8.1.6
8.2.0
8.2.4
8.3.0
8.3.3
8.3.8
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmvite
Corregida 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3 -15 d · -15 d · -15 d · -15 d · -15 d 8.3.8 no afectada
npmvite-plus
Corregida 1.1.0 -14 d 1.6.0 no afectada
Versiones corregidas1.1.06.4.47.3.78.1.68.2.48.3.3
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-2026-112946
Otrahttps://github.com/vitejs/vite/security/advisories/GHSA-rq7h-c2jc-7f22
Otrahttps://github.com/vitejs/vite/pull/23656
Otrahttps://github.com/vitejs/vite/commit/170b92791421bcd484f7325936d989a82d6bd4aa
Otrahttps://github.com/vitejs/vite/commit/45c0e3392a298626955a0ab93a8e51232daac721
Otrahttps://github.com/vitejs/vite/commit/c3e06f92e969952466b4e2f5801e85e1e00cd905
Otrahttps://github.com/vitejs/vite/commit/e570d8d016096b5f8f6f09808376ca6cf73f27d0
Otrahttps://github.com/vitejs/vite/commit/f0d76c7da13d5e794807b82f0b86c1931a8438e3
Otrahttps://github.com/vitejs/vite

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