Share
## https://sploitus.com/exploit?id=5B3C3ACB-78E0-56ED-B4E2-5EF8E515663D
# 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//CVE-2025-9074-POC.git
cd CVE-2025-9074-POC

# Run the PoC
python3 poc_cve_2025_9074.py :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  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).

---