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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2025-9074 PoC — Docker Desktop allows unauthenticated access to Docker Engine API from containers

Source
Associated Vulnerability
Title: Docker Desktop allows unauthenticated access to Docker Engine API from containers (CVE-2025-9074)
Description:A vulnerability was identified in Docker Desktop that allows local running Linux containers to access the Docker Engine API via the configured Docker subnet, at 192.168.65.7:2375 by default. This vulnerability occurs with or without Enhanced Container Isolation (ECI) enabled, and with or without the "Expose daemon on tcp://localhost:2375 without TLS" option enabled. This can lead to execution of a wide range of privileged commands to the engine API, including controlling other containers, creating new ones, managing images etc. In some circumstances (e.g. Docker Desktop for Windows with WSL backend) it also allows mounting the host drive with the same privileges as the user running Docker Desktop.
Description
Proof-of-Concept exploit for CVE-2025-9074 - Unauthenticated Docker API exposure allowing arbitrary container creation and host filesystem access.
Readme
# CVE-2025-9074 - Docker API Unauthenticated Access PoC

## 📌 Overview
This repository provides a Proof-of-Concept (PoC) exploit for **CVE-2025-9074**, which involves unauthenticated exposure of the Docker Engine API on TCP port `2375`.  
An attacker who can access this exposed API can:
- Interact with the Docker daemon without authentication.
- Pull arbitrary images.
- Create and run containers with **bind mounts to the host filesystem**, resulting in host compromise.

---

## ⚠️ Legal Disclaimer
This PoC is released **for educational and authorized security testing purposes only**.  
Unauthorized exploitation of systems is illegal and unethical.  
Use this PoC only on environments you **own** or have **explicit permission** to test.

---

## 🧪 Vulnerability Details
- **CVE ID:** [CVE-2025-9074](https://nvd.nist.gov/vuln/detail/CVE-2025-9074)  
- **Affected Component:** Docker Engine API (TCP)  
- **Default Port:** `2375`  
- **Attack Type:** Remote, unauthenticated  
- **Impact:** Full host filesystem access via malicious container

---

## 🛠️ Requirements
- Python 3.x
- `requests` library

Install dependencies:
```bash
pip install requests
````

---

## 🧰 Local Testing Setup

If you're testing this PoC on your local machine, make sure the Docker API is exposed over TCP without TLS.
On **Docker Desktop**, follow these steps:

1. Open **Docker Desktop**.
2. Go to **Settings → General**.
3. Scroll down to **"Expose daemon on tcp://localhost:2375 without TLS"**.
4. ✅ Check this option.
5. Click **Apply & Restart**.

⚠️ **Warning:** This option disables authentication on the Docker API.
Any local or remote attacker who can reach `localhost:2375` can control your Docker daemon.
Only enable this in isolated testing environments — **never in production**.

Once enabled, you can verify with:

```bash
curl http://127.0.0.1:2375/info
```

If the API responds with JSON containing `"ServerVersion"`, then the daemon is exposed correctly.

---

## 🚀 Usage

```bash
# Clone this repository
git clone https://github.com/<your-username>/CVE-2025-9074-POC.git
cd CVE-2025-9074-POC

# Run the PoC
python3 poc_cve_2025_9074.py <target_ip>:2375
```

If no target is provided, the script will prompt for input and default to `127.0.0.1:2375`.

---

## 🧰 PoC Steps

1. **Check API availability**
   Confirms if the Docker API responds to `/info`.

2. **Pull `alpine` image**
   Ensures the required base image is available.

3. **Prepare malicious container payload**
   Creates a container with host filesystem bind-mounted at `/mnt`.

4. **Create the container**
   Sends a container creation request.

5. **Start the container**
   Container is started, providing access to the host filesystem.

6. **Post-exploitation**
   Example:

   ```bash
   docker exec -it <container_id> sh
   ls /mnt
   ```

---

## 🧠 Mitigation

* **Disable** `Expose daemon on tcp://localhost:2375 without TLS` in Docker Desktop after testing.
* Use **TLS certificates** if remote API exposure is required.
* **Restrict network access** to the Docker daemon (port 2375) using firewall rules.
* Consider using service mesh / network policies to limit exposure.

---

## 🧑‍💻 Author

* **OilSeller2001**
* GitHub: [https://github.com/oilseller2001](https://github.com/oilseller2001)

*PoC script co-developed with Gemini AI during research.*

---

## 🪪 License

This PoC is released under the [MIT License](LICENSE).

---

File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
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 →