CVE-2026-51886: Langflow: code injection in validate/code enables RCE
GHSA-w584-2h2r-2hvfHIGHPoC AVAILABLECISA: ATTENDLangflow 1.7.2 through 1.10.0 has a code injection flaw in the /api/v1/validate/code endpoint: any authenticated user can submit Python that the server executes without sandboxing, which gives full remote code execution on the host. The CVSS score is 8.8 and the EPSS percentile is only 68% (0.004). There is no public exploit, Nuclei template or KEV listing yet, but the practical risk is higher than those numbers suggest. Langflow has 192 other CVEs, and AIID #1578 (JADEPUFFER) reportedly shows an LLM-driven ransomware operator turning a vulnerable internet-facing Langflow deployment into a database-extortion operation. Upgrade to 1.10.1 now. Until then, remove internet exposure, restrict who can authenticate, and rotate any API keys or database credentials stored in flows.
What is the risk?
High. The attack is network-based, low complexity, needs only low privileges and no user interaction, and it compromises confidentiality, integrity and availability (CVSS 8.8). The EPSS of 0.00403 (68th percentile) and the lack of a public exploit, Nuclei template or KEV entry lower the short-term probability of exploitation. Several factors raise the real risk. The vulnerable code path is a simple, well-known pattern (compile/exec of user-supplied code). Langflow has a long history of similar flaws (192 CVEs in the package). The fix commit and PR are public, so a working exploit can be derived quickly. Self-registration or weak authentication in a Langflow deployment turns the 'authenticated' requirement into a weak barrier. Exposure is highest in deployments reachable from the internet or shared across many internal users.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Langflow | pip | >= 1.7.2, < 1.10.1 | 1.10.1 |
Do you use Langflow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step1) Upgrade langflow to 1.10.1 or later (fix in PR #13696 / commit e7c33dba). 2) If you cannot patch immediately, block or restrict access to /api/v1/validate/code at the reverse proxy or WAF, and remove public internet exposure. 3) Disable open sign-up and enforce strong authentication (SSO/MFA) with the minimum number of users. 4) Run Langflow as a non-root user in a hardened container with no sensitive host mounts, restricted egress and network segmentation from production databases. 5) Rotate every secret accessible to the Langflow process (LLM API keys, DB credentials, cloud tokens) if exposure is suspected. 6) Detect: look in access logs for POST requests to /api/v1/validate/code from unexpected accounts or IPs, and in endpoint telemetry for child processes, outbound connections or file writes originating from the Langflow Python process.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-51886?
Langflow 1.7.2 through 1.10.0 has a code injection flaw in the /api/v1/validate/code endpoint: any authenticated user can submit Python that the server executes without sandboxing, which gives full remote code execution on the host. The CVSS score is 8.8 and the EPSS percentile is only 68% (0.004). There is no public exploit, Nuclei template or KEV listing yet, but the practical risk is higher than those numbers suggest. Langflow has 192 other CVEs, and AIID #1578 (JADEPUFFER) reportedly shows an LLM-driven ransomware operator turning a vulnerable internet-facing Langflow deployment into a database-extortion operation. Upgrade to 1.10.1 now. Until then, remove internet exposure, restrict who can authenticate, and rotate any API keys or database credentials stored in flows.
Is CVE-2026-51886 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2026-51886, increasing the risk of exploitation.
How to fix CVE-2026-51886?
1) Upgrade langflow to 1.10.1 or later (fix in PR #13696 / commit e7c33dba). 2) If you cannot patch immediately, block or restrict access to /api/v1/validate/code at the reverse proxy or WAF, and remove public internet exposure. 3) Disable open sign-up and enforce strong authentication (SSO/MFA) with the minimum number of users. 4) Run Langflow as a non-root user in a hardened container with no sensitive host mounts, restricted egress and network segmentation from production databases. 5) Rotate every secret accessible to the Langflow process (LLM API keys, DB credentials, cloud tokens) if exposure is suspected. 6) Detect: look in access logs for POST requests to /api/v1/validate/code from unexpected accounts or IPs, and in endpoint telemetry for child processes, outbound connections or file writes originating from the Langflow Python process.
What systems are affected by CVE-2026-51886?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, LLM workflow orchestration, RAG pipelines, low-code AI flow builders.
What is the CVSS score for CVE-2026-51886?
CVE-2026-51886 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.60%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0012Valid AccountsAML.T0049Exploit Public-Facing ApplicationAML.T0050Command and Scripting InterpreterAML.T0055Unsecured CredentialsCompliance Controls Affected
What are the technical details?
Original Advisory
langflow-ai langflow v1.9.3 is affected by: Code Injection. The impact is: execute arbitrary code (remote). The component is: src/backend/base/langflow/api/v1/validate.py:validate-post_validate_code-a-real-authenticated-http-post-to-api-v1. The attack vector is: Attack surface: HTTP or browser-backed service path. A public-facing route accepts raw Python source and forwards it into a server-side compile/exec validation path without any visible entitlement guard. ¶¶ A weakness has been identified in langflow-ai langflow up to 1.9.3. langflow contains a code injection vulnerability in validate-post_validate_code-a-real-authenticated-http-post-to-api-v1 (src/backend/base/langflow/api/v1/validate.py:13). An authenticated attacker can execute arbitrary Python code on the server by submitting malicious code to the /api/v1/validate/code endpoint, which directly executes user-supplied code without sandboxing or security controls.
Exploitation Scenario
An attacker obtains low-privilege access to a Langflow instance, for example through open registration, a leaked credential or a shared team account. They send a POST request to /api/v1/validate/code containing Python source whose top-level code or decorators run when the server compiles and executes it. The code launches a reverse shell or reads environment variables, which gives the attacker the LLM API keys and the connection strings of the databases the flows use. From there they move to the connected production database, exfiltrate the data and demand a ransom, as reportedly happened in the JADEPUFFER case with an LLM-driven agent.
Weaknesses (CWE)
CWE-94 — Improper Control of Generation of Code ('Code Injection'): The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
- [Architecture and Design] Refactor your program so that you do not have to dynamically generate code.
- [Architecture and Design] Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product. Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HReferences
- gist.github.com/Ro1ME/c11b1e63e4e8fca6b25275144f25ec2a
- github.com/langflow-ai/langflow/issues/13336
- github.com/advisories/GHSA-w584-2h2r-2hvf
- github.com/langflow-ai/langflow/commit/e7c33dbaade20b5295c7fa26bf83cc1ff68fba02
- github.com/langflow-ai/langflow/pull/13696
- github.com/langflow-ai/langflow/releases/tag/v1.10.1
- github.com/langflow-ai/langflow/security/advisories/GHSA-w584-2h2r-2hvf
- nvd.nist.gov/vuln/detail/CVE-2026-51886
Timeline
Related Vulnerabilities
CVE-2026-1056110.0Langflow: auth bypass + unauthenticated RCE (CVSS 10)
Same package: langflowCVE-2026-1013410.0Langflow: unauthenticated RCE via tool_code injection
Same package: langflowCVE-2026-333099.9langflow: Path Traversal enables file access
Same package: langflowCVE-2026-552559.9Langflow: IDOR allows cross-user flow execution
Same package: langflowCVE-2026-78739.9Langflow: authenticated RCE enables credential theft
Same package: langflow