CVE-2026-7700: Langflow: Prompt injection in Langflow Smart Transform can lead to code execution
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 langflowSearch 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.3The 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: S307For 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
lambdaand contains a colon. A lambda that calls__import__meets both conditions, andeval()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
Read for this analysis:
- https://github.com/langflow-ai/langflow/security/advisories/GHSA-9fpm-3445-2vx4
- https://nvd.nist.gov/vuln/detail/CVE-2026-7700
- https://github.com/langflow-ai/langflow/pull/13530
- https://github.com/langflow-ai/langflow/commit/1641b28f33e2c47b9a0c6855922d44d1b8418b9d
- https://github.com/langflow-ai/langflow/commit/94859df33acd70b2a1f816e26d68f5e89a7e5639
- https://github.com/langflow-ai/langflow/releases/tag/v1.10.3
- https://vuldb.com/submit/804305
- https://vuldb.com/vuln/360869
- https://www.yuque.com/mengnanbulalei/ognlsk/hte2a98ro5gf8tp9?singleDoc#%20%E3%80%8AFirst%20release%20of%20Langflow%201.8.3%20Smart%20Transform%20eval()/Lambda%20injection%20RCE%20vulnerability%20analysis+POC%E3%80%8B
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 entriesCVE-2026-105697
Langflow: OS command injection (RCE) via arbitrary command in MCP stdio server configuration
critical9.9Oct 7, 2026CVE-2026-105698
Langflow : Cross-user flow access and vertex execution via deprecated /api/v1/build/{flow_id}/vertices endpoints
medium5.4Oct 7, 2026CVE-2026-105699
Langflow has Authenticated Cross-Project File Disclosure via Unscoped MCP Resource Handlers
high7.1Oct 7, 2026CVE-2026-105741
Langflow: IP Spoofing Bypass via `X-Forwarded-For` Allowing Remote Configuration Write
high7.1Oct 7, 2026CVE-2026-10561
Langflow: PythonREPLComponent executes unsandboxed Python code, enabling authenticated RCE and privilege escalation
critical9.9Oct 6, 2026GHSA-j8f7-x8jm-wmm4
Langflow: SSRF in URL-taking components (protection disabled by default / warn-only, not applied to RSS, SearXNG, Web Search, Home Assistant, Glean, Docling)
medium6.3Oct 6, 2026
