Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query
CISA confirms exploitation of this vulnerability in real attacks. Prioritise checking whether your application is affected. CISA KEV · CC0 1.0
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) 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
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | vite | >= 6.2.0, < 6.2.4, >= 6.1.0, < 6.1.3, >= 6.0.0, < 6.0.13, >= 5.0.0, < 5.4.16, < 4.5.11 | 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11 |
References
- https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8
- https://nvd.nist.gov/vuln/detail/CVE-2025-31125
- https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949
- https://github.com/vitejs/vite
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-31125
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-200, CWE-284- Platform
- npm
- Package
vite- Disclosed
- 31.03.2025
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-4r4m-qw57-chr8 - CC BY 4.0
Vulnerability history: vite
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 24
- First → latest
- 08.2022 10.2026
- Without a fix
- 0
- Exploited in attacks
- 1
Severity breakdown
- High 8
- Medium 14
- Low 2
Disclosures per year
- 2022: 1
- 2023: 2
- 2024: 4
- 2025: 9
- 2026: 8
-
Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.