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

Goal: 1000 CNY Β· Raised: 1000 CNY

100.0%

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):**

* πŸ“§ **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/](https://0xgh057r3c0n.github.io/)

---

## πŸ“ 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/6e2aadb904f8802bf9cd83115f464db5c7efe391 β”œβ”€β”€ [2.1K] CVE-2025-31125.yaml β”œβ”€β”€ [3.4K] exploit.py β”œβ”€β”€ [1.1K] LICENSE β”œβ”€β”€ [189K] logo.png β”œβ”€β”€ [3.6K] README.md └── [ 34] requirements.txt 1 directory, 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 β†’