Langflow: Prompt injection in Langflow Smart Transform can lead to code execution
Langflow
More for Langflow RSS feed for Langflow
- Severity
- High, CVSS 8.8
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Record
- CVE-2026-7700
- Affects
- Langflow
- Known exploited
- Not listed in the CISA Known Exploited Vulnerabilities catalog
- Published
- Record first published by the source
- October 5, 2026
- Source last modified
- October 5, 2026
Description
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
Description quoted from the NVD record.
Who is affected
Langflow is a tool for building apps that use AI language models. This flaw affects versions 1.3.0 through 1.10.2 and sits in Smart Transform, a building block that asks an AI model to write a small piece of code and then runs it. Someone who can create or edit workflows can use it to run their own commands. If a workflow passes outside content into Smart Transform, an attacker may also trick the AI model into producing harmful code. An attacker could read or change login details, files, data and network resources that Langflow can reach, and may affect other users on shared setups. This flaw is rated High.
What to do
- Whoever installed or runs Langflow for your organization, or the IT provider or vendor who manages it, should act on this advisory.
- Update Langflow to version
1.10.3or later. - If an IT provider or vendor runs Langflow for you, send them this advisory and ask when the update will be done.
- Until you can update, remove Smart Transform from workflows that can be run, and allow only trusted users to create, edit and run workflows.
- Until then, also do not send untrusted or outside data through Smart Transform, and limit Langflow's access to files, the network and login details.
Analysis written from the source record as of October 5, 2026 and reviewed before publishing.