Cloudanix VulnDB

CVE-2025-3248

Critical · 9.8 CISA KEV · ransomware

Langflow Vulnerable to Code Injection via the `/api/v1/validate/code` endpoint

CVSS

9.8

EPSS

100.0%

Published

Apr 7, 2025

CISA due date

May 26, 2025

Cloudanix analysis

Act now SSVC: Act

Attackers can take over unpatched Langflow servers remotely, potentially stealing secrets, disrupting operations, or deploying ransomware.

Active In The Wild Wormable
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Trivial
Impact
Remote Code Execution
Component
Application
Class
Authentication Bypass
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

Langflow versions before 1.3.0 expose the /api/v1/validate/code endpoint in a way that allows remote, unauthenticated code injection. Because the endpoint is intended to validate user-supplied code, insufficient authentication and unsafe handling of submitted code can let an attacker cause the Langflow server process to execute arbitrary Python or operating-system commands with the privileges of the service account. Successful exploitation can result in full application compromise, credential theft from environment variables or configuration files, lateral movement from the host, installation of malware, and disruption or destruction of data and workflows.

Why it matters to the business

This is a critical, actively exploited internet-facing remote code execution issue with a CVSS score of 9.8, an EPSS score near 1.0, CISA KEV listing, and reported ransomware use; unpatched Langflow deployments should be treated as high-priority compromise risks. If exploited, attackers can take control of AI workflow infrastructure, steal secrets used to access models, APIs, cloud services, or internal systems, interrupt automation pipelines, deploy ransomware or miners, and use the server as a foothold into broader environments. The CISA KEV remediation deadline was 2025-05-26, and the vulnerability has been public for a long period, increasing the likelihood that exposed systems have already been scanned or attacked.

How an attack unfolds

An attacker first identifies an exposed Langflow instance and checks whether the /api/v1/validate/code API is reachable without authentication. They then send a crafted HTTP request containing malicious code to the validation endpoint. On vulnerable versions, the server evaluates or processes the submitted content unsafely, causing attacker-controlled code to run in the context of the Langflow application process. After initial code execution, the attacker commonly performs discovery, reads environment variables and configuration files for API keys or database credentials, establishes persistence through cron jobs, startup scripts, containers, or additional user accounts, downloads follow-on tooling, and may deploy ransomware, cryptominers, web shells, reverse shells, or data exfiltration utilities. Public exploitation activity and KEV ransomware association mean defenders should assume opportunistic mass scanning and hands-on-keyboard follow-up are both plausible.

How to fix it

Upgrade Langflow to version 1.3.0 or later, or to a build that includes the upstream fix commit 6c2ff92ccf083f038d9a97a749b4e0f30a60247a. For Red Hat Enterprise Linux 8 packages listed as affected, apply vendor updates that bring platform-python, platform-python-debug, platform-python-devel, python3, python3-debuginfo, python3-debugsource, python3-idle, python3-libs, python3-test, and python3-tkinter in both AppStream and BaseOS to 0:3.6.8-45.el8 or later as applicable. If immediate upgrade is not possible, remove public exposure, block unauthenticated access to /api/v1/validate/code at a reverse proxy or WAF, require strong authentication before any Langflow API access, restrict network access to trusted administrative networks, run the service with least privilege, rotate secrets accessible to Langflow, and isolate the host from sensitive internal networks. Because this vulnerability is actively exploited and associated with ransomware activity, mitigation alone should be considered temporary and should be paired with compromise assessment.

How to confirm the fix worked

Confirm the installed Langflow version is 1.3.0 or later, or verify the deployed source includes commit 6c2ff92ccf083f038d9a97a749b4e0f30a60247a. On RHEL 8 systems, verify relevant Python packages report 0:3.6.8-45.el8 or later using the platform package manager. From an unauthenticated network location, test that /api/v1/validate/code is not accessible without authorization and does not process code-submission requests. Review reverse proxy, API gateway, and application routing rules to ensure the endpoint is authenticated or blocked. Validate that Langflow runs as a non-root user with minimal filesystem and network permissions. After patching, restart the application and dependent services, then review logs for residual access attempts to the vulnerable endpoint.

Typical attack path

  1. Scan the internet or internal networks for exposed Langflow services.
  2. Fingerprint the service version or test reachability of /api/v1/validate/code.
  3. Send an unauthenticated crafted request to /api/v1/validate/code containing code or expressions intended to execute on the server.
  4. Execute initial commands under the Langflow service account to confirm code execution and gather host context.
  5. Read environment variables, configuration files, tokens, API keys, and credentials accessible to the Langflow process.
  6. Download or stage additional tools such as reverse shells, credential dumpers, cryptominers, ransomware payloads, or tunneling utilities.
  7. Establish persistence using scheduled tasks, cron entries, modified startup scripts, container changes, or new credentials.
  8. Move laterally or access connected services using stolen secrets.
  9. Exfiltrate data, disrupt workflows, encrypt files, or use the host for further attacks.

How to detect it

Review historical logs from application servers, reverse proxies, load balancers, API gateways, WAFs, container platforms, EDR, and host audit sources for unauthenticated or unusual requests to /api/v1/validate/code, especially POST requests with Python code fragments, shell commands, encoded payloads, or download-and-execute behavior. Correlate suspicious requests with Langflow application logs showing code validation errors, stack traces, unexpected successful validation responses, or high volumes of requests from unfamiliar IPs. On hosts and containers, look for child processes spawned by the Langflow or Python service process, including shells, curl, wget, python one-liners, nc, ncat, bash, sh, powershell, or package managers. Inspect environment-variable access, reads of configuration or secret files, outbound connections shortly after suspicious API calls, and creation of persistence mechanisms such as cron jobs, systemd services, authorized_keys entries, startup scripts, or modified container images. Because this issue is associated with ransomware use, also search for mass file modification, encryption notes, suspicious archive creation, data staging, disabled security tools, miner processes, and outbound connections to unknown command-and-control infrastructure. Include threat-intelligence context for public exploitation campaigns described as CVE-2025-3248 exploitation and Langflow missing authentication exploitation, but do not rely only on named actor indicators because opportunistic exploitation is likely.

  • /api/v1/validate/code
  • POST /api/v1/validate/code
  • "/api/v1/validate/code" 200
  • "/api/v1/validate/code" 400
  • "/api/v1/validate/code" 500
  • validate/code
  • __import__
  • import os
  • import subprocess
  • subprocess.Popen
  • subprocess.run
  • os.system
  • eval(
  • exec(
  • open('/etc/passwd'
  • /etc/passwd
  • /bin/sh
  • /bin/bash
  • bash -c
  • sh -c
  • curl http
  • curl -s
  • wget http
  • wget -q
  • nc -e
  • ncat -e
  • python -c
  • python3 -c
  • pty.spawn
  • /dev/tcp/
  • chmod +x
  • crontab -e
  • /var/spool/cron
  • /etc/cron.d/
  • /etc/systemd/system/
  • authorized_keys
  • nohup
  • disown
  • xmrig
  • kinsing
  • kdevtmpfsi
  • langflow
  • python

What your security team should do

  • Immediately inventory all Langflow deployments, including containers, developer servers, AI lab environments, and externally reachable instances.
  • Prioritize emergency upgrade to Langflow 1.3.0 or later, or a build containing commit 6c2ff92ccf083f038d9a97a749b4e0f30a60247a; apply RHEL package fixes to 0:3.6.8-45.el8 or later where relevant.
  • If exposure cannot be removed immediately, block unauthenticated requests to /api/v1/validate/code at the edge and restrict Langflow access to trusted networks or VPN-authenticated users.
  • Treat internet-exposed vulnerable instances as potentially compromised and perform forensic review before returning them to service.
  • Rotate credentials, API keys, model provider tokens, database passwords, cloud keys, and other secrets that may have been available to the Langflow process.
  • Hunt across web, reverse proxy, container, EDR, and host logs for suspicious requests to /api/v1/validate/code and child processes spawned by the Langflow Python process.
  • Check for ransomware, cryptomining, reverse shell, and persistence artifacts on affected hosts.
  • Add SIEM and WAF detections for requests to /api/v1/validate/code containing Python execution primitives, shell metacharacters, or download-and-execute patterns.
  • Ensure Langflow is not run with root privileges and is isolated from sensitive internal systems using network segmentation and least-privilege service accounts.
  • Track KEV-driven remediation status and document closure because the CISA due date was 2025-05-26 and exploitation is active in the wild.

The record

Langflow versions prior to 1.3.0 are susceptible to code injection in the `/api/v1/validate/code` endpoint. A remote and unauthenticated attacker can send crafted HTTP requests to execute arbitrary code.

Affected packages

Ecosystem Package Introduced Fixed
PyPI langflow 0 1.3.0
PyPI langflow-base 0 0.3.0

Related vulnerabilities