8.2high
Vite Affected by Arbitrary File Read via Vite Dev Server WebSocket
- Severity
- 8.2high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 3.47% (higher than 89% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-p9ff-h696-f583
Description
Vite is a frontend tooling framework for JavaScript. From 6.0.0 to before 6.4.2, 7.3.2, and 8.0.5, if it is possible to connect to the Vite dev server’s WebSocket without an Origin header, an attacker can invoke fetchModule via the custom WebSocket event vite:invoke and combine file://... with ?raw (or ?inline) to retrieve the contents of arbitrary files on the server as a JavaScript string (e.g., export default "..."). The access control enforced in the HTTP request path (such as server.fs.allow) is not applied to this WebSocket-based execution path. This vulnerability is fixed in 6.4.2, 7.3.2, and 8.0.5.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vitejs vite | >= 8.0.0, < 8.0.5, >= 7.0.0, < 7.3.2, >= 6.0.0, < 6.4.2, from 6.0.0 up to 6.4.1, from 7.0.0 up to 7.3.1, from 8.0.0 up to 8.0.4 | CVE List, NVD |
| vitejs vite-plus | < 0.1.16 | CVE List |
| automation-gateway | Not specified Not affected: from 0:2.5.20260422-3.el8ap before *, from 0:2.5.20260422-3.el9ap before * | CVE List |
| automation-platform-ui | Not specified Not affected: from 0:2.6.9-1.el9ap before * | CVE List |
| ansible-automation-platform-tech-preview/mcp-server-rhel9 | Not specified Not affected: from 1779783248 before * | CVE List |
| ansible-automation-platform-27/gateway-rhel9 | Not specified Not affected: from 1787218409 before * | CVE List |
| rhacs-eng/release-main | Not specified | CVE List |
| automation-controller | Not specified | CVE List |
| automation-eda-controller | Not specified | CVE List |
| vite | Not specified | CVE List |
| podman-desktop-macos-1-0 | Not specified | CVE List |
| podman-desktop-windows-1-0 | Not specified | CVE List |
| redhat-user-workloads/bootc-ext | Not specified | CVE List |
| redhat-user-workloads/openshift-local-ext | Not specified | CVE List |
| redhat-user-workloads/rhel-ext | Not specified | CVE List |
| redhat-user-workloads/art-images | Not specified | CVE List |
| vite (npm) | from 8.0.0 before 8.0.5, from 7.0.0 before 7.3.2, from 6.0.0 before 6.4.2 | GitHub Advisory Database |
| voidzero vite+ | up to 0.1.15 | NVD |
All scores
| GitHub_M | 8.2high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
| redhat-SADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Classification
What each source says
CVE List
Vite is a frontend tooling framework for JavaScript. From 6.0.0 to before 6.4.2, 7.3.2, and 8.0.5, if it is possible to connect to the Vite dev server’s WebSocket without an Origin header, an attacker can invoke fetchModule via the custom WebSocket event vite:invoke and combine file://... with ?raw (or ?inline) to retrieve the contents of arbitrary files on the server as a JavaScript string (e.g., export default "..."). The access control enforced in the HTTP request path (such as server.fs.allow) is not applied to this WebSocket-based execution path. This vulnerability is fixed in 6.4.2, 7.3.2, and 8.0.5.
GitHub Advisory Database
Summary
server.fs check was not enforced to the fetchModule method that is exposed in Vite dev server's WebSocket.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using
--hostorserver.hostconfig option) - WebSocket is not disabled by
server.ws: false
Arbitrary files on the server (development machine, CI environment, container, etc.) can be exposed.
Details
If it is possible to connect to the Vite dev server’s WebSocket without an Origin header, an attacker can invoke fetchModule via the custom WebSocket event vite:invoke and combine file://... with ?raw (or ?inline) to retrieve the contents of arbitrary files on the server as a JavaScript string (e.g., export default "...").
The access control enforced in the HTTP request path (such as server.fs.allow) is not applied to this WebSocket-based execution path.
PoC
-
Start the dev server on the target Example (used during validation with this repository):
pnpm -C playground/alias exec vite --host 0.0.0.0 --port 5173 -
Confirm that access is blocked via the HTTP path (example: arbitrary file)
curl -i 'http://localhost:5173/@fs/etc/passwd?raw'Result:
403 Restricted(outside the allow list) image -
Confirm that the same file can be retrieved via the WebSocket path By connecting to the HMR WebSocket without an
imageOriginheader and sending avite:invokerequest that callsfetchModulewith afile://...URL and?raw, the file contents are returned as a JavaScript module.
NVD (es)
Vite es un framework de herramientas de frontend para JavaScript. Desde la versión 6.0.0 hasta antes de las versiones 6.4.2, 7.3.2 y 8.0.5, si es posible conectarse al WebSocket del servidor de desarrollo de Vite sin una cabecera Origin, un atacante puede invocar fetchModule a través del evento WebSocket personalizado vite:invoke y combinar file://... con ?raw (o ?inline) para recuperar el contenido de archivos arbitrarios en el servidor como una cadena de JavaScript (por ejemplo, export default '...'). El control de acceso aplicado en la ruta de solicitud HTTP (como server.fs.allow) no se aplica a esta ruta de ejecución basada en WebSocket. Esta vulnerabilidad se corrige en las versiones 6.4.2, 7.3.2 y 8.0.5.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-39363 changed 2026-08-25 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-p9ff-h696-f583 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-39363 changed 2026-08-25 | Public domain |