Langflow: Prompt injection in Langflow Smart Transform can lead to code executionGHSA-9fpm-3445-2vx4
HIGHFix: langflow-ai/langflow#13530GHSA-9fpm-3445-2vx4 is a high-severity (CVSS 8.8) CWE-74 vulnerability in langflow. A fix is available for langflow — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-9fpm-3445-2vx4.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-9fpm-3445-2vx4 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
langflowReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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: 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) of Endor Labs — reporter (original finder)
- SZXSec — reporter (duplicate report)
- cyjhhh — reporter (duplicate report)
- 0gur1 — reporter (duplicate report)
- ajm4n — reporter (duplicate report, Finding 1 of a multi-finding submission)
- andifilhohub — analyst
- Jordan Frazier (jordanrfrazier) — remediation developer
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | langflow | ≥ 1.3.0&&< 1.10.3 | 1.10.3pip install --upgrade 'langflow==1.10.3' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for langflow, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update langflow to 1.10.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9fpm-3445-2vx4 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is GHSA-9fpm-3445-2vx4 in your dependencies?
Find it across PyPI, including transitive dependencies.