Advisories / npm / vite / CVE-2025-31125
Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query (CVE-2025-31125)
CVE-2025-31125 GHSA-4r4m-qw57-chr8 Published 31 Mar 2025
Fixed in vite 4.5.11 and 5.4.16 and 6.0.13 and 6.1.3 and 6.2.4.
$ npm install vite@^4.5.11 $ npm install vite@^5.4.16 $ npm install vite@^6.0.13 $ npm install vite@^6.1.3
Run the one for the major version you’re on: each fix stays within its release line.
Which versions are affected
| Package | Affected | Fixed in |
|---|---|---|
| vite | < 4.5.11≥ 5.0.0, < 5.4.16≥ 6.0.0, < 6.0.13≥ 6.1.0, < 6.1.3≥ 6.2.0, < 6.2.4 | 4.5.115.4.166.0.136.1.36.2.4 |
Check a site from its project folder:
npm ls vite
shows the installed version. Or paste the lock file into the lock file checker to check every package at once.
Timeline
- Advisory published, with a fix
- Added to CISA’s exploited list
Questions
Which version of vite is safe from CVE-2025-31125?
6.2.4 and later. Versions affected: < 4.5.11, ≥ 5.0.0, < 5.4.16, ≥ 6.0.0, < 6.0.13, ≥ 6.1.0, < 6.1.3, ≥ 6.2.0, < 6.2.4.
Is CVE-2025-31125 being exploited?
Yes. CISA added it to its Known Exploited Vulnerabilities list on 22 January 2026, which means it has been used in real attacks. Upgrade as soon as you can.