NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Langflow

CVE-2026-7700: Langflow: Prompt injection in Langflow Smart Transform can lead to code execution

highCVSS 3.1 8.8GHSA-9fpm-3445-2vx4

Langflow's Smart Transform component (`LambdaFilterComponent`) asks an LLM to write a Python lambda and then runs it with `eval()` after only a format check. A flow author, or an attacker whose text reaches the component through prompt injection, can get code execution in the Langflow process. Versions 1.3.0 up to 1.10.3 are affected. Upgrade to 1.10.3.

Published Oct 5, 2026 · Analysis Oct 22, 2026

What an attacker can do

Smart Transform puts the author's instructions and a preview of the input data into a prompt. It extracts a one-line lambda from the model's reply and checks only that the text starts with lambda and contains a colon (_validate_lambda in src/lfx/src/lfx/components/llm_operations/lambda_filter.py). Then eval(lambda_text) builds the function with Python's full builtins, and _execute_lambda calls it. A reply such as lambda x: __import__("os").system("id") passes the check and runs.

There are two routes. A malicious flow author can write the payload straight into the Instructions field. Alternatively, if an exposed flow passes outside content (a chat message, document or web page) into Smart Transform, an attacker can try to inject an instruction that makes the model emit the malicious lambda. That second route depends on the configured model following the injected text.

Success gives code execution as the Langflow service account. That exposes credentials, files and network access the process holds, and in shared deployments can reach other tenants. The CVSS vector requires a low-privilege login.

Who is affected

langflow >= 1.3.0, < 1.10.3. Only flows that include the Smart Transform component are exposed, and the indirect route needs a flow that feeds untrusted content to it. Check the version:

pip show langflow

Search your saved flows for Smart Transform / LambdaFilterComponent.

langflow

Ecosystem
PyPI
Affected
>= 1.3.0, < 1.10.3
Fixed in
1.10.3
Check
pip show langflow

How to fix it

Upgrade to langflow 1.10.3 or later:

pip install -U langflow==1.10.3

The mainline fix (PR #13530) shipped in 1.11.0, and PR #14071 is the 1.10.3 backport. They validate the generated code's AST and evaluate it with a restricted builtins mapping.

Workarounds until you can upgrade, from the advisory:

  • Remove Smart Transform from runnable flows.
  • Restrict flow creation, editing and execution to trusted users.
  • Do not route untrusted data through Smart Transform.
  • Limit the Langflow process's filesystem, network and credential access.

How to tell if you were hit

Review saved flows for Smart Transform components and read their Instructions fields for unexpected content. Check flow run logs for model outputs that contain __import__, os.system or subprocess. On the host, look for child processes spawned by the Langflow service and for outbound connections it does not normally make. The sources give no dedicated log line. Beam records agent shell commands and file access, which is useful if an agent can submit text to such a flow.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Langflow versions 1.3.0 through 1.10.2 contain a code-injection vulnerability in the Smart Transform (LambdaFilterComponent) component.

Smart Transform places flow-author instructions and a preview of its input data into a prompt asking an LLM to generate a Python lambda. It then extracts a one-line lambda from the model response, applies only syntactic format checks, evaluates it with Python's full builtins, and invokes the resulting function inside the Langflow process.

A malicious flow author can exploit this directly through the Instructions field. In deployments where an exposed flow passes attacker-controlled content into Smart Transform, an attacker may also exploit it indirectly through prompt injection, subject to the configured model following the injected instruction.

Vulnerability details

Vulnerable Code Location: src/lfx/src/lfx/components/llm_operations/lambda_filter.py (line 242 in v1.10.2)

def _validate_lambda(self, lambda_text: str) -> bool:
    """Validate the provided lambda function text."""
    return lambda_text.strip().startswith("lambda") and ":" in lambda_text

# ...
return eval(lambda_text)  # noqa: S307

For example, an attacker can attempt to make the model return:

lambda x: __import__("os").system("id")

This expression satisfies the vulnerable format checks. eval() creates the lambda with access to Python's default builtins, and the subsequent fn(data) invocation (in _execute_lambda) executes the command.

Successful exploitation allows code execution with the privileges of the Langflow service process. This can expose or modify credentials, files, application data, and network resources accessible to that process, and may affect other tenants in shared deployments.

PoC

https://github.com/user-attachments/assets/13c48fe1-7225-4e0d-9687-2d2df1e87f0e

Fix

The reported path was addressed by validating the generated code's AST and evaluating it with a restricted builtins mapping.

The mainline fix is in PR #13530 (1641b28f) and shipped in Langflow 1.11.0. The 1.10.3 backport is in PR #14071 (94859df3). Users should upgrade to Langflow 1.10.3 or later.

Workarounds

Until an upgrade is possible:

  • Remove Smart Transform from runnable flows.
  • Restrict flow creation, editing, and execution to trusted users.
  • Do not route untrusted or externally controlled data through Smart Transform.
  • Limit the Langflow process's filesystem, network, and credential access.

Credit

  • Peyton Kennedy ([p80n-sec](https://github.com/p80n-sec)) of Endor Labs — reporter (original finder)
  • [SZXSec](https://github.com/SZXSec) — reporter (duplicate report)
  • [cyjhhh](https://github.com/cyjhhh) — reporter (duplicate report)
  • [0gur1](https://github.com/0gur1) — reporter (duplicate report)
  • [ajm4n](https://github.com/ajm4n) — reporter (duplicate report, Finding 1 of a multi-finding submission)
  • [andifilhohub](https://github.com/andifilhohub) — analyst
  • Jordan Frazier ([jordanrfrazier](https://github.com/jordanrfrazier)) — remediation developer

Credited to p80n-sec, andifilhohub, ajm4n.

Questions

Can prompt injection alone trigger code execution here?

Possibly. If an exposed flow passes attacker-controlled content into Smart Transform, the attacker may get the model to return a malicious lambda. It depends on the model following the injected instruction.

Why doesn't the format check stop it?

It only tests that the text starts with lambda and contains a colon. A lambda that calls __import__ meets both conditions, and eval() gives it full builtins.

Which version fixes CVE-2026-7700?

Langflow 1.10.3 for the 1.10 line, and 1.11.0 on the main line. Both restrict builtins and validate the AST before running the lambda.

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

More Langflow vulnerabilities

All Langflow entries