Goal Reached Thanks to every supporter โ€” we hit 100%!

Goal: 1000 CNY ยท Raised: 1110 CNY

100%

CVE-2025-31125 PoC โ€” Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query

Source
Associated Vulnerability
Title:Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query (CVE-2025-31125)
Description:Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. 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 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.
Description
Vite WASM Import Path Traversal ๐Ÿ›ก๏ธ
Readme
# CVE-2025-31125 Exploit - Vite WASM Import Path Traversal ๐Ÿ›ก๏ธ

This script is a **proof-of-concept (PoC)** exploit for **CVE-2025-31125**, a vulnerability found in **Vite**. The exploit leverages a **WASM Import Path Traversal** issue to retrieve sensitive files from vulnerable servers running the Vite framework. It allows attackers to access files like `/etc/passwd`, `/etc/shadow`, `/etc/hosts`, and other sensitive files exposed by the server. โš ๏ธ

---

## ๐Ÿšจ **Disclaimer**

This tool is **for educational purposes only** and **should only be used on systems you own or have explicit permission to test**. **Unauthorized access to systems is illegal** and can result in legal consequences. **Use this tool responsibly**! โš–๏ธ

---

## โœจ Features

- Exploits **Vite WASM Import Path Traversal** vulnerability (CVE-2025-31125). ๐Ÿš€
- Extracts and decodes **embedded base64 WASM** content from vulnerable servers. ๐Ÿ“œ
- Supports multiple file paths, including `/etc/passwd`, `/etc/shadow`, and more! ๐Ÿ’ป
- Test multiple URLs from a **file** containing one URL per line. ๐Ÿ—‚๏ธ
- **SSL certificate verification** can be disabled for testing environments. ๐Ÿ”
- Custom path traversal for different file paths on vulnerable servers. ๐Ÿ› ๏ธ

---

## ๐Ÿ–ฅ๏ธ Requirements

- Python 3.6 or higher ๐Ÿ
- `requests` library ๐Ÿ“ฆ
- `urllib3` library ๐Ÿ”’
- `toilet` (optional, for banner) ๐ŸŽจ

### Install Python dependencies:

```bash
pip3 install -r requirements.txt
````

To install `toilet` (optional for banner) on your system:

* On **Ubuntu/Debian**: `sudo apt install toilet`
* On **MacOS**: `brew install toilet`

---

## ๐Ÿš€ Installation

1. Clone the repository to your local machine:

```bash
git clone https://github.com/0xgh057r3c0n/CVE-2025-31125.git
cd CVE-2025-31125
```

2. Install required Python dependencies:

```bash
pip3 install -r requirements.txt
```

---

## ๐Ÿ’ป Usage

To use the script, provide either a **single target URL** using `-u` or a **file with multiple target URLs** using `-f`.

### Available Arguments:

* `-u, --url`: Target a **single** URL. ๐ŸŒ
* `-f, --file`: Provide a file with a list of target URLs (one per line). ๐Ÿ“„
* `--path`: Specify the **path** to exploit (e.g., `/etc/passwd`, `/etc/shadow`). Default is `/etc/passwd`. ๐Ÿ› ๏ธ
* `--no-verify`: Disable **SSL verification** (useful for self-signed certificates). ๐Ÿ”’

### Examples:

#### Single Target with Default Path (`/etc/passwd`)

```bash
python3 exploit.py -u https://example.com --no-verify
```

#### Single Target with Custom Path (`/etc/shadow`)

```bash
python3 exploit.py -u https://example.com --no-verify --path /etc/shadow
```

#### Multiple Targets from File with Default Path (`/etc/passwd`)

```bash
python3 exploit.py -f targets.txt --no-verify
```

#### Multiple Targets from File with Custom Path (`/etc/hosts`)

```bash
python3 exploit.py -f targets.txt --no-verify --path /etc/hosts
```

---

## ๐Ÿ“ž Contact Info

๐Ÿ™‹โ€โ™‚๏ธ **Contact (For Collaboration, Research & Cybersecurity Discussions):**

* ๐Ÿ“ž **Phone**: +91 8876072154
* ๐Ÿ“ง **Email**: [gauravbhattacharjee54@gmail.com](mailto:gauravbhattacharjee54@gmail.com)
* ๐Ÿ”— **LinkedIn**: [Gaurav Bhattacharjee](https://www.linkedin.com/in/gaurav-bhattacharjee/)
* ๐Ÿ™ **GitHub**: [0xgh057r3c0n](https://github.com/0xgh057r3c0n)
* ๐ŸŒ **Portfolio**: [https://0xgh057r3c0n.github.io/portfolio/](https://0xgh057r3c0n.github.io/portfolio/)

---

## ๐Ÿ“ License

This project is licensed under the **MIT License**. ๐ŸŒŸ

---

## ๐Ÿ–ผ๏ธ Logo

![Logo](logo.png)

---

### โš ๏ธ **Important Note:**

* **Use this tool responsibly** only on authorized targets.
* **Unauthorized access to networks or systems is illegal.** ๐Ÿ”ด
* This tool is **for educational purposes only**.

---
File Snapshot

[4.0K] /data/pocs/31c9eb86c3f7c5f1c04dc91ce3ede05a5509c13b โ”œโ”€โ”€ [2.1K] CVE-2025-31125.yaml โ”œโ”€โ”€ [3.4K] exploit.py โ”œโ”€โ”€ [1.1K] LICENSE โ”œโ”€โ”€ [189K] logo.png โ”œโ”€โ”€ [3.7K] README.md โ””โ”€โ”€ [ 34] requirements.txt 0 directories, 6 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 โ†’