# CVE-2025-30208: Vite bypasses server.fs.deny when using `?raw??`

> Attackers can read arbitrary files by bypassing server.fs.deny restrictions in Vite dev servers exposed to the network.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 24 Mar 2025
- **Updated:** 24 Mar 2025
- **Also known as:** GHSA-x574-m823-4x7w, MINI-8g8g-g9xj-8mm9, ROOT-APP-NPM-CVE-2025-30208

## What is CVE-2025-30208?

CVE-2025-30208 is a medium-severity path traversal vulnerability in vitejs vite, published on 24 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Vite, a provider of frontend development tooling, has a vulnerability in versions prior to 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10. `@fs` denies access to files outside of Vite serving allow list. Adding `?raw??` or `?import&raw??` to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as `?` are removed in several places, but are not accounted for in query string regexes. The contents of arbitrary files can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using `--host` or `server.host` config option) are affected. Versions 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10 fix the issue.

Weakness: CWE-284 (Improper Access Control), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2025-30208?

10 open source packages ship an affected version, including vite. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `vite` | npm | All versions | 4.5.10 |
| `vite` | npm | All versions | 4.5.10 |
| `vite` | npm | From 5.0.0 | 5.4.15 |
| `vite` | npm | From 5.0.0 | 5.4.15 |
| `vite` | npm | From 6.0.0 | 6.0.12 |
| `vite` | npm | From 6.0.0 | 6.0.12 |
| `vite` | npm | From 6.1.0 | 6.1.2 |
| `vite` | npm | From 6.1.0 | 6.1.2 |
| `vite` | npm | From 6.2.0 | 6.2.3 |
| `vite` | npm | From 6.2.0 | 6.2.3 |

Products: Vitejs Vite.

## How do I fix CVE-2025-30208?

Upgrade vite to a fixed version for your release line: 4.5.10, 5.4.15, 6.0.12 or 6.1.2.

## Is CVE-2025-30208 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-30208 exists.

Public exploit code:

- CVE-2025-30208-EXP (github_poc): https://github.com/ThumpBo/CVE-2025-30208-EXP
- 全网首发 CVE-2025-31125 CVE-2025-30208 CVE-2025-32395 Vite Scanner (github_poc): https://github.com/xuemian168/CVE-2025-30208
- A PoC of the exploit script for the Arbitrary File Read vulnerability of Vite /@fs/ Path Traversal in the transformMiddleware (CVE-2025-30208).  (github_poc): https://github.com/4xura/CVE-2025-30208
- CVE-2025-30208-EXP 任意文件读取 (github_poc): https://github.com/marino-admin/Vite-CVE-2025-30208-Scanner
- CVE‑2025‑30208 is a medium-severity arbitrary file read vulnerability in the Vite development server (a popular frontend build tool) (github_poc): https://github.com/ThemeHackers/CVE-2025-30208
- 针对CVE-2025-30208和CVE-2025-31125的漏洞利用 (github_poc): https://github.com/jackieya/ViteVulScan

## Other vulnerabilities in vitejs vite

- [CVE-2025-31125](https://insights.sbomify.com/CVE-2025-31125/): Vite Vitejs Improper Access Control (medium 5.3, exploited in the wild)
- [CVE-2026-53571](https://insights.sbomify.com/CVE-2026-53571/): Vite: `server.fs.deny` bypass on Windows alternate paths (high 8.2)
- [CVE-2026-39363](https://insights.sbomify.com/CVE-2026-39363/): Vite Affected by Arbitrary File Read via Vite Dev Server WebSocket (high 8.2)
- [CVE-2026-39364](https://insights.sbomify.com/CVE-2026-39364/): Vite has a `server.fs.deny` bypass with queries (high 8.2)
- [CVE-2024-23331](https://insights.sbomify.com/CVE-2024-23331/): Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-30208 and fix it if it is affected.

What it is: CVE-2025-30208 is a medium-severity path traversal vulnerability in vitejs vite, published on 24 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-30208 exists.

Affected packages and fixed versions:
- vite (npm): affected all versions; fixed in 4.5.10
- vite (npm): affected all versions; fixed in 4.5.10
- vite (npm): affected from 5.0.0; fixed in 5.4.15
- vite (npm): affected from 5.0.0; fixed in 5.4.15
- vite (npm): affected from 6.0.0; fixed in 6.0.12
- vite (npm): affected from 6.0.0; fixed in 6.0.12
- vite (npm): affected from 6.1.0; fixed in 6.1.2
- vite (npm): affected from 6.1.0; fixed in 6.1.2
- vite (npm): affected from 6.2.0; fixed in 6.2.3
- vite (npm): affected from 6.2.0; fixed in 6.2.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-30208/ (Markdown: https://insights.sbomify.com/CVE-2025-30208/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-30208
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-30208
- OSV: https://osv.dev/vulnerability/CVE-2025-30208

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-30208/
Summaries are generated and may contain mistakes; the official description above is the record.
