CVE Tools
Back to blog

CVE-2025-3248: the Langflow endpoint that 'validates' your code by running it

A missing-auth Python code-injection flaw in Langflow's /api/v1/validate/code gives unauthenticated RCE -- and it is on CISA KEV, weaponized in Metasploit, and used in the wild to drop the Flodrix botnet and to launch the first agentic-AI ransomware case

CVE-2025-3248 lets anyone who can merely reach a Langflow server execute code on it with no credentials. The bug lives in POST /api/v1/validate/code -- an endpoint whose entire job is to check whether a user's Python snippet is valid before it becomes a flow component. The cruel twist is in the name: to validate the code, Langflow parses it and then compiles and executes it. So 'validating' the code is the same as running it. Because Langflow often sits on developer or MLOps infrastructure holding model API keys and cloud credentials, code execution there is an unusually rich foothold.

What the flaw actually is

The vulnerable endpoint takes a JSON body of the form {"code": "..."}, parses it with Python's ast module, and then compiles and exec()s the parsed definitions to surface syntax errors. There is no sandbox around that execution. The result is classic code injection (CWE-94) stacked on top of missing authentication (CWE-306): the endpoint is reachable pre-auth in versions before 1.3.0.

The clever part -- discovered and disclosed by Horizon3.ai -- is why parsing runs the payload. In Python, two things are evaluated the instant a function is defined, not when it is called: its decorator expressions (@something) and its default-argument expressions (def f(x=something)). So an attacker never has to invoke anything. They submit code that merely defines a function whose decorator or default argument is a call like exec(...), and the validator runs it the moment it compiles the definition. Output comes back in-band -- wrapping the payload in raise Exception(<command output>) surfaces the result inside the error message the endpoint returns, so no separate callback server is needed. AST parsing gives no protection here because defining code is not free of side effects.

The exploitation chain

From a single unauthenticated request to code execution, and then to one of two documented outcomes -- a DDoS botnet or a fully automated ransomware intrusion. Each stage has a cheap chokepoint, and the most effective one is simply never exposing the Langflow API to an untrusted network.

CVE-2025-3248 exploitation chain -- unauth /validate/code to RCE to botnet or ransomware

  1. Reachable Langflow &lt; 1.3.0 (port 7860) — An internet- or untrusted-reachable Langflow instance below 1.3.0, typically bound to 0.0.0.0:7860 with auto-login on. If it is isolated and patched, the chain stops here.
  2. Unauth POST /api/v1/validate/code — A single unauthenticated JSON request to the 'validate' endpoint -- no session, no credentials.
  3. AST-parse then compile() + exec() — The endpoint parses and executes the definition. Python evaluates decorator and default-argument expressions at definition time, so parsing the payload runs it.
  4. Code execution as the Langflow process user — The attacker now runs arbitrary Python and OS commands; output is exfiltrated in-band via raise Exception(...). What happens next depends on the operator.
  5. Flodrix DDoS botnet — Recon, then a 'docker'/'deez' downloader pulls a multi-arch Flodrix ELF: Tor + TCP/UDP C2 (80.66.75.121), self-delete, .system_idle persistence, DDoS floods.
  6. JADEPUFFER agentic-AI ransomware — Per Sysdig: an LLM agent autonomously recons, harvests secrets, pivots to a Nacos config store and encrypts 1,342 items for extortion.
  7. PREVENT: patch 1.3.0+ / isolate 7860 / kill auto-login — Cheapest, highest-value chokepoint: upgrade to 1.3.0+, never expose port 7860, front it with an authenticating proxy, and set LANGFLOW_AUTO_LOGIN=false.
  8. DETECT: external POST to /validate/code — Alert on any external-sourced POST to /api/v1/validate/code -- the endpoint is essentially never called by legitimate external clients.
  9. HUNT: app process spawns shell; C2 80.66.75.121 — Post-exploit tell: uvicorn/python spawning shells or unknown ELFs, outbound to the Flodrix C2, a hidden .system_idle file, docker/deez droppers.

Am I affected?

Every Langflow release before 1.3.0 is vulnerable -- Horizon3 notes the flawed pattern dated back roughly two years, so this is the whole pre-1.3.0 line, not a recent regression. The fix is 1.3.0 or later. The critical scoping fact is exposure: the endpoint is reachable pre-auth, and Langflow's typical default is to bind 0.0.0.0:7860 with auto-login enabled. Read a server's version safely with a GET to /api/v1/version (that is read-only and does not touch the vulnerable endpoint) and compare against 1.3.0.

AxisValueWhat it means
CVSS 3.19.8 Critical (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)Unauthenticated, network-reachable, low-complexity, full impact
EPSS~0.9997 (about the 99.97th percentile)Among the most likely-to-be-exploited CVEs tracked
CISA KEVListed 2025-05-05, federal due date 2025-05-26Real-world exploited; a federal patch mandate under BOD 22-01
Exploited in the wildYes -- Flodrix botnet and the JADEPUFFER agentic-ransomware caseTwo distinct payloads; ~360-370 scanning IPs observed (GreyNoise)
Public exploitExploitDB, Metasploit module, Nuclei template, several GitHub PoCsPoint-and-click weaponization for any operator
Affected / fixedVulnerable: all versions < 1.3.0. Fixed: 1.3.0+ (auth gate, PR #6911)Fix is auth-only -- pair it with disabling auto-login
PreconditionA reachable instance; default 0.0.0.0:7860 with auto-login onNetwork isolation or patching removes the remote path

Exploited in the wild -- carefully stated

Exploitation began roughly two days after the public proof-of-concept and never really stopped. Trend Micro documented a campaign that chains the flaw to deploy Flodrix, a DDoS botnet in the LeetHozer/Mirai lineage: after gaining a shell, attackers run recon commands, exfiltrate the results, and pull a downloader script (named docker, also seen as deez) that fetches an architecture-specific Flodrix binary. The malware opens Tor and TCP/UDP command-and-control channels to a hardcoded IP, deletes itself from disk and memory, and uses a hidden .system_idle file for persistence. Censys later mapped that C2 and observed roughly 745 infected hosts -- about half internet-connected cameras -- so the botnet spreads well beyond Langflow, which is simply a lucrative entry point.

Disclosure to exploitation

  1. Reported to vendor
    Horizon3.ai reports the flaw to Langflow/DataStax (February 2025)
  2. Patched in 1.3.0
    Langflow ships the auth gate via PR #6911 (late March 2025)
  3. Public disclosure + PoC
    Horizon3 publishes the write-up; a working exploit appears the same day
  4. Exploitation begins
    Scanning ~2 days after the PoC; recon from Tor exit nodes seen by SANS ISC
  5. Added to CISA KEV
    Federal remediation due 2025-05-26 under BOD 22-01
  6. Flodrix botnet campaign
    Trend Micro documents in-the-wild use to deploy the Flodrix DDoS bot
  7. JADEPUFFER agentic ransomware
    Sysdig reports an LLM-agent-driven ransomware case using this flaw for initial access

Detection & hunting

The single most useful fact for defenders: /api/v1/validate/code is essentially never called by a legitimate external client. So an unauthenticated POST to it from outside your network is high-signal on its own -- you do not need to match the exact payload. Watch the endpoint, then watch the host.

  • Request-side: any external-sourced POST /api/v1/validate/code is the anomaly. Payload tells include @exec(, __import__, and subprocess inside the body, but the endpoint plus an external source is already enough to alert.
  • Safe exposure check: GET /api/v1/version (read-only) and flag anything below 1.3.0; fingerprint port 7860 or search html:"Langflow" on Shodan/Censys for your external surface. Prefer this over the Nuclei template, which confirms the bug by actively reading /etc/passwd.
  • Post-exploit on the host: the Langflow app runs under uvicorn/python -- hunt that process spawning /bin/sh, curl, wget, or an unknown ELF from /tmp or /dev/shm, correlated to a preceding /validate/code request.
  • Flodrix artifacts: outbound to 80.66.75.121 (the XOR-decrypted C2), a hidden .system_idle file, and downloader scripts named docker/deez. Validate IOCs before blocking -- the published Flodrix ELF hashes are ARM/IoT samples, not necessarily the dropper on a typical Langflow host.
# PROPOSED, NOT OFFICIAL - flags a POST to the Langflow validate endpoint from a
# non-internal source. Replace the CIDRs with your real internal ranges and tune
# the field names to your proxy/web log schema.
title: Langflow CVE-2025-3248 validate/code attempt from external source
status: experimental
logsource:
  category: proxy
detection:
  selection:
    cs-method: 'POST'
    cs-uri-stem|contains: '/api/v1/validate/code'
  internal_src:
    src_ip|cidr:
      - '10.0.0.0/8'
      - '172.16.0.0/12'
      - '192.168.0.0/16'
  condition: selection and not internal_src
fields: [src_ip, dst_ip, cs-uri-stem, sc-status]
level: high

What to do now

  1. Patch to Langflow 1.3.0 or later (the fix adds the authentication gate from PR #6911). Later releases are fine; the CISA KEV federal due date was 2025-05-26, but exposure -- not the KEV date -- is your trigger.
  2. If you cannot patch today: take the service off the internet (bind to localhost or a private subnet and firewall it), front it with an authenticating reverse proxy, and block /api/v1/validate/code from untrusted networks.
  3. Disable auto-login and set a real admin: LANGFLOW_AUTO_LOGIN=false plus a configured superuser. Because the fix is auth-only, auto-login can re-open the hole even on a patched build.
  4. Assume attempted compromise if you were exposed and unpatched after ~2025-04-09: hunt for the Flodrix artifacts and anomalous outbound connections above before you close the ticket.
  5. Prioritise: internet-reachable instances below 1.3.0 first (hours), internal-but-reachable next, isolated dev instances on normal cadence -- and verify that 'isolated' really is.

FAQ

Is it really unauthenticated remote code execution?
Yes -- in versions before 1.3.0 the /api/v1/validate/code endpoint requires no login, and it executes the Python you submit while 'validating' it. A public Metasploit module and Nuclei template both confirm code execution.
Which versions are affected, and does patching fully fix it?
All Langflow versions before 1.3.0 are vulnerable; 1.3.0+ adds an authentication gate. But the fix is auth-only -- it does not sandbox the underlying execution -- so an authenticated user can still run code, and instances left with auto-login enabled can remain exploitable. Patch and disable auto-login and keep it off the public internet.
It is old (2025) -- can I ignore it?
No. It is still on KEV with a top-percentile EPSS, still being scanned, and it was the entry point for a 2026 agentic-ransomware case. Any exposed instance below 1.3.0 is a live risk today.
Is this the same as the Langflow cryptominer bug?
No. The 2026 Monero-miner campaign against Langflow abuses CVE-2026-33017, a separate and newer flaw. Same product, different vulnerability -- do not conflate the two.

Sources