AgentbeamBeta
AI agent vulnerability · Langflow

CVE-2025-3248: Langflow Unauth RCE

criticalCVSS 4.0 9.3ExploitedGHSA-rvqx-wpfh-mfx7

Langflow before 1.3.0 (and `langflow-base` before 0.3.0) lets an unauthenticated attacker run arbitrary Python through the `/api/v1/validate/code` endpoint. CISA lists it as exploited in the wild, and it is tied to ransomware use. Upgrade to 1.3.0, or keep the instance off untrusted networks.

Published Jun 17, 2025 · Updated Oct 27, 2026 · Analysis Nov 17, 2026

What an attacker can do

The /api/v1/validate/code endpoint checks user-supplied Python by parsing it with ast and then calling exec. Imports are checked, and function definitions are compiled and executed. Defining a function does not run its body. But decorators and default argument values are evaluated at definition time. A payload placed in either one runs during validation, even though the function is never called.

The attacker sends one POST request with a JSON body whose code field holds such a function. No login is needed on affected versions. Horizon3 showed a variant that raises an exception carrying command output, so the result comes back in the HTTP response. The code runs as the Langflow process. That gives the attacker the API keys and model provider credentials stored in flows, files on the host, and a foothold on the network. The fix puts the endpoint behind authentication. It does not remove the code execution path, and logged-in users can still run code by design.

Who is affected

Affected: langflow below 1.3.0 and langflow-base below 0.3.0, on pip. Any instance whose port is reachable by an attacker is at risk, including internet-facing ones. Check both packages:

pip show langflow
pip show langflow-base

For containers, check the image tag. Anything that reaches the Langflow API without a login counts as exposed.

langflow

Ecosystem
PyPI
Affected
< 1.3.0
Fixed in
1.3.0
Check
pip show langflow

langflow-base

Ecosystem
PyPI
Affected
< 0.3.0
Fixed in
0.3.0
Check
pip show langflow-base

How to fix it

Upgrade to langflow 1.3.0, and langflow-base 0.3.0 if you install it directly:

pip install --upgrade langflow==1.3.0

The patch requires authentication on the vulnerable endpoint. Horizon3 also advises restricting network access to the instance. Keep Langflow off the public internet, behind a VPN or an authenticating proxy.

CISA's required action: apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or stop using the product if no mitigation is available. The due date was 2025-05-26. It binds US federal agencies. Others should treat it as overdue.

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

How to tell if you were hit

Search web or proxy logs for POST requests to /api/v1/validate/code from outside addresses, especially without an auth header. Inspect the request bodies for function definitions with unusual decorators or default arguments. On the host, look for child processes of the Langflow Python process such as sh, curl or wget, and for new files or cron entries. Rotate API keys stored in Langflow if you saw such requests. CISA marks it as used in ransomware campaigns.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to chximn-dt.

Questions

Is CVE-2025-3248 exploited in the wild?

Yes. CISA added it to the Known Exploited Vulnerabilities catalog on 2025-05-05, with a due date of 2025-05-26, and flags known ransomware use.

Does the attacker need to log in?

No. On versions before 1.3.0 the /api/v1/validate/code endpoint accepts requests without authentication. The CVSS vector is network, no privileges, no user interaction.

Does 1.3.0 remove the code execution?

No. According to Horizon3 the patch puts the endpoint behind authentication. Authenticated users can still run code by design, so do not expose Langflow to untrusted users.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

Coverage on the Beam blog

More Langflow vulnerabilities

All Langflow entries