Vite allows server.fs.deny to be bypassed with .svg or relative paths
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Information disclosure, Security bypass
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Partial Red Hat: 4 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-200 and CWE-284.
Summary
Vite is a frontend tooling framework for javascript. The contents of arbitrary files can be returned to the browser. By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the server.fs.deny restriction was able to bypass. This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, and 6.2.5.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| vitejs | vite | before 4.5.12; 5.0.0 to before 5.4.17; 6.0.0 to before 6.0.14; 6.1.0 to before 6.1.4; 6.2.0 to before 6.2.5 | 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5 | Patch available | CNA |
| — | vite (npm) | 6.2.0 to before 6.2.5 | 6.2.5 | Patch available | GHSA-xcj6-pq6g-qj4x |
| — | vite (npm) | 6.1.0 to before 6.1.4 | 6.1.4 | Patch available | GHSA-xcj6-pq6g-qj4x |
| — | vite (npm) | 6.0.0 to before 6.0.14 | 6.0.14 | Patch available | GHSA-xcj6-pq6g-qj4x |
| — | vite (npm) | 5.0.0 to before 5.4.17 | 5.4.17 | Patch available | GHSA-xcj6-pq6g-qj4x |
| — | vite (npm) | before 4.5.12 | 4.5.12 | Patch available | GHSA-xcj6-pq6g-qj4x |
- vite Vendorvitejs Affected before 4.5.12; 5.0.0 to before 5.4.17; 6.0.0 to before 6.0.14; 6.1.0 to before 6.1.4; 6.2.0 to before 6.2.5 Fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5 Patch available CNA
- vite (npm) Vendor— Affected 6.2.0 to before 6.2.5 Fixed in 6.2.5 Patch available GHSA-xcj6-pq6g-qj4x
- vite (npm) Vendor— Affected 6.1.0 to before 6.1.4 Fixed in 6.1.4 Patch available GHSA-xcj6-pq6g-qj4x
- vite (npm) Vendor— Affected 6.0.0 to before 6.0.14 Fixed in 6.0.14 Patch available GHSA-xcj6-pq6g-qj4x
- vite (npm) Vendor— Affected 5.0.0 to before 5.4.17 Fixed in 5.4.17 Patch available GHSA-xcj6-pq6g-qj4x
- vite (npm) Vendor— Affected before 4.5.12 Fixed in 4.5.12 Patch available GHSA-xcj6-pq6g-qj4x
Remediation
- Fix · CNA vite (vitejs) Fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5
- Fix · GHSA-xcj6-pq6g-qj4x vite (npm) Fixed in 6.2.5 Advisory →
- Fix · GHSA-xcj6-pq6g-qj4x vite (npm) Fixed in 6.1.4 Advisory →
- Fix · GHSA-xcj6-pq6g-qj4x vite (npm) Fixed in 6.0.14 Advisory →
- Fix · GHSA-xcj6-pq6g-qj4x vite (npm) Fixed in 5.4.17 Advisory →
- Fix · GHSA-xcj6-pq6g-qj4x vite (npm) Fixed in 4.5.12 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat JBoss Enterprise Application Platform 8 | Affected | No fix yet: Fix deferred |
| Red Hat JBoss Enterprise Application Platform Expansion Pack | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift distributed tracing 3 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-31486
- 2026-10-03 Alias added: GHSA-xcj6-pq6g-qj4x
References
Other 4
- https://github.com/vitejs/vite/security/advisories/GHSA-xcj6-pq6g-qj4x
- https://github.com/vitejs/vite/commit/62d7e81ee189d65899bb65f3263ddbd85247b647
- https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290
- https://github.com/vitejs/vite
More vitejs vulnerabilities
- TI-2025-22386 Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query KEVCVSS 3.1HIGH 7.5
- TI-2025-41248 Code injection in vitejs vite-plugin-react CVSS 3.1CRITICAL 9.8
- TI-2026-28350 Vite Affected by Arbitrary File Read via Vite Dev Server WebSocket CVSS 4.0HIGH 8.2
- TI-2025-41735 @vitejs/plugin-rsc has Arbitrary File Read via `/__vite_rsc_findSourceMapURL` Endpoint on Development CVSS 3.1HIGH 7.5
- TI-2025-21544 Vite bypasses server.fs.deny when using `?raw??` CVSS 3.1HIGH 7.5
- TI-2023-16938 Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//) CVSS 3.1HIGH 7.5
Sources
- CVE-2025-31486 · CVE Program
- CVE-2025-31486 · NVD
- FIRST EPSS
- GHSA-xcj6-pq6g-qj4x · GitHub Advisory Database · CC BY 4.0
- CVE-2025-31486 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences