Threats affecting pkg:npm/vitejs/vite
8 threats
Most recently published first
| Severity | CVSS | Signals | Threat | Source | Published | Score and star |
|---|---|---|---|---|---|---|
| Medium | 6.9 | EPSS 0.3% | Medium6.9EPSS 0.3%CVE Database V5CVE-2026-118662 Vite versions from 6.4.4 up to but not including 6.4.5 have a vulnerability where the development server improperly evaluates file access restrictions before removing certain loader query parameters. This allows an unauthenticated attacker to bypass deny rules and access sensitive files if the server is network-exposed. The issue is fixed in version 6.4.5. | CVE Database V5 | ||
| Medium | 6.3 | EPSS 0.5% | CVE-2026-112947vitejs vite · Path Traversal Medium6.3EPSS 0.5%CVE Database V5CVE-2026-112947 CVE-2026-112947 is a path traversal vulnerability in the Vite development server that allows an attacker to retrieve the first 4 bytes of arbitrary files on disk by sending a request with the query parameter '?vite-wasm-instance'. This occurs because the internal Wasm plugin's load hook reads files without applying server.fs access restrictions. The vulnerability affects Vite versions >=0.2.8 <1.1.0, >=8.2.0 <8.2.4, and >=8.3.0 <8.3.3. It only impacts applications that expose the Vite dev server to the network, run on Node.js or Deno, and have sensitive information in the first 4 bytes of a file. The issue is fixed in versions 1.1.0, 8.2.4, and 8.3.3. | CVE Database V5 | ||
| Low | 2.1 | EPSS 0.7% | CVE-2026-112945vitejs vite · Basic XSS Low2.1EPSS 0.7%CVE Database V5CVE-2026-112945 CVE-2026-112945 is a cross-site scripting (XSS) vulnerability in the Vite frontend tooling framework affecting versions prior to 6.4.4, 7.3.7, 8.1.6, 8.2.4, and 8.3.3. The flaw arises when applications using custom middleware pass an unchanged browser request URL to server.transformIndexHtml, allowing attacker-controlled module execution via crafted development-server pages. This can expose sensitive data or permit critical actions in the affected application. The issue has been fixed in the specified versions. | CVE Database V5 | ||
| High | 8.2 | EPSS 0.6% | CVE-2026-53571vitejs vite · Path Traversal High8.2EPSS 0.6%CVE Database V5CVE-2026-53571 ### Summary The contents of files that are specified by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) can be returned to the browser on Windows. ### 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)) - the sensitive file exists in the allowed directories specified by [`server.fs.allow`](https://vite.dev/config/server-options#server-fs-allow) - either of: - the sensitive file exists in an NTFS volume - the dev server is running on Windows and the sensitive file exists in a volume that 8.3 short name generation is enabled (it is enabled by default on system volumes) ### Details Vite’s dev server denies direct access to sensitive files through `server.fs.deny`, including entries such as `.env`, `.env.*`, and `*.{crt,pem}`. However, on Windows, the deny logic does not correctly normalize NTFS ADS path forms before access checks are applied. Because of this, requests such as `/.env::$DATA?raw` are treated as allowed paths, while Windows resolves them to the original file's default data stream. Similar to that, Windows allows accessing a file using a different name with the 8.3 short name compatibility feature. Vite did not reject accessing files via them. ### PoC ```bash $ npm create vite@latest $ cd vite-project/ $ npm install $ npm run dev ``` Access via browser at `http://localhost:5173/.env::$DATA?raw` <img width="388" height="129" alt="deecc1315123883cfd0f9c26a002845a" src="https://github.com/user-attachments/assets/895c6012-4e2e-4a35-babb-69bbf3ee7170" /> Example expected result: - `/.env::$DATA?raw` returns the contents of `.env` - `/tls.pem::$DATA?raw` returns the contents of `tls.pem` | CVE Database V5 | ||
| High | 8.2 | EPSS 2.3% | High8.2EPSS 2.3%CVE Database V5CVE-2026-39364 ### Summary The contents of files that are specified by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) can be returned to the browser. ### 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)) - the sensitive file exists in the allowed directories specified by [`server.fs.allow`](https://vite.dev/config/server-options#server-fs-allow) - the sensitive file is denied with a pattern that matches a file by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) ### Details On the Vite dev server, files that should be blocked by `server.fs.deny` (e.g., `.env`, `*.crt`) can be retrieved with HTTP 200 responses when query parameters such as `?raw`, `?import&raw`, or `?import&url&inline` are appended. ### PoC 1. Start the dev server: `pnpm exec vite root --host 127.0.0.1 --port 5175 --strictPort` 2. Confirm that `server.fs.deny` is enforced (expect 403): `curl -i http://127.0.0.1:5175/src/.env | head -n 20` <img width="3944" height="1092" alt="image" src="https://github.com/user-attachments/assets/ecb9f2e0-e08f-4ac7-b194-e0f988c4cd4f" /> 3. Confirm that the same files can be retrieved with query parameters (expect 200): <img width="2014" height="373" alt="image" src="https://github.com/user-attachments/assets/76bc2a6a-44f4-4161-ae47-eab5ae0c04a8" /> | CVE Database V5 | ||
| High | 8.2 | EPSS 3.4% | CVE-2026-39363vitejs vite · Information Exposure High8.2EPSS 3.4%CVE Database V5CVE-2026-39363 ### Summary [`server.fs`](https://vite.dev/config/server-options#server-fs-strict) 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 `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host)) - 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 1. Start the dev server on the target Example (used during validation with this repository): ```bash pnpm -C playground/alias exec vite --host 0.0.0.0 --port 5173 ``` 2. Confirm that access is blocked via the HTTP path (example: arbitrary file) ```bash curl -i 'http://localhost:5173/@fs/etc/passwd?raw' ``` Result: `403 Restricted` (outside the allow list) <img width="3898" height="1014" alt="image" src="https://github.com/user-attachments/assets/f6593377-549c-45d7-b562-5c19833438af" /> 3. Confirm that the same file can be retrieved via the WebSocket path By connecting to the HMR WebSocket without an `Origin` header and sending a `vite:invoke` request that calls `fetchModule` with a `file://...` URL and `?raw`, the file contents are returned as a JavaScript module. <img width="1049" height="296" alt="image" src="https://github.com/user-attachments/assets/af969f7b-d34e-4af4-8adb-5e2b83b31972" /> <img width="1382" height="955" alt="image" src="https://github.com/user-attachments/assets/6a230d2e-197a-4c9c-b373-d0129756d5d7" /> | CVE Database V5 | ||
| Medium | 5.3 | KEVMirageEPSS 74% | CVE-2025-31125vitejs vite · Information Exposure Medium5.3KEVMirageEPSS 74%CVE Database V5CVE-2025-31125 ### Summary The contents of arbitrary files can be returned to the browser. ### Impact Only apps explicitly exposing the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host)) are affected. ### Details - base64 encoded content of non-allowed files is exposed using `?inline&import` (originally reported as `?import&?inline=1.wasm?init`) - content of non-allowed files is exposed using `?raw?import` `/@fs/` isn't needed to reproduce the issue for files inside the project root. ### PoC Original report (check details above for simplified cases): The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice ``` $ npm create vite@latest $ cd vite-project/ $ npm install $ npm run dev ``` Example full URL `http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init` | CVE Database V5 | ||
| Medium | 6.1 | EPSS 1.0% | CVE-2023-49293vitejs vite · Cross-site Scripting Medium6.1EPSS 1.0%CVE Database V5CVE-2023-49293 Vite is a website frontend framework. When Vite's HTML transformation is invoked manually via `server.transformIndexHtml`, the original request URL is passed in unmodified, and the `html` being transformed contains inline module scripts (`<script type="module">...</script>`), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string to `server.transformIndexHtml`. Only apps using `appType: 'custom'` and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker. This issue has been addressed in vite@5.0.5, vite@4.5.1, and vite@4.4.12. There are no known workarounds for this vulnerability. | CVE Database V5 |
Page 1 of 1