CVE-2026-27966: CWE-94: Improper Control of Generation of Code ('Code Injection') in langflow-ai langflow
CVE-2026-27966 is a critical remote code execution vulnerability in langflow versions prior to 1. 8. 0. The flaw arises because the CSV Agent node hardcodes allow_dangerous_code=True, exposing LangChain’s Python REPL tool. This allows attackers to execute arbitrary Python and OS commands via prompt injection without authentication or user interaction. The vulnerability has a CVSS score of 9. 8, indicating high impact on confidentiality, integrity, and availability. Although no known exploits are currently in the wild, unpatched systems remain at significant risk. Version 1. 8.
AI Analysis
Technical Summary
CVE-2026-27966 is a critical vulnerability classified under CWE-94 (Improper Control of Generation of Code) affecting langflow, a tool used to build and deploy AI-powered agents and workflows. Prior to version 1.8.0, the CSV Agent node in langflow hardcodes the parameter allow_dangerous_code=True. This setting exposes LangChain’s Python REPL tool (python_repl_ast), which is designed to evaluate Python code dynamically. Because this REPL is exposed without restrictions, an attacker can leverage prompt injection techniques to execute arbitrary Python code and underlying operating system commands on the server hosting langflow. The vulnerability requires no authentication or user interaction, making it remotely exploitable over the network. The impact includes full remote code execution (RCE), allowing attackers to compromise confidentiality, integrity, and availability of the affected system. The vulnerability was publicly disclosed on February 26, 2026, with a CVSS v3.1 base score of 9.8, reflecting its critical severity. Although no known exploits have been observed in the wild yet, the ease of exploitation and the critical nature of the flaw necessitate immediate remediation. The issue is fixed in langflow version 1.8.0 by removing the hardcoded dangerous code execution flag, thereby preventing exposure of the Python REPL tool.
Potential Impact
The vulnerability enables attackers to execute arbitrary code remotely on servers running vulnerable versions of langflow, potentially leading to complete system compromise. This can result in unauthorized data access, data manipulation, destruction of data, and disruption of AI workflows. Organizations relying on langflow for AI agent deployment may face operational downtime, loss of intellectual property, and exposure of sensitive information. The critical severity and lack of authentication requirements increase the risk of automated attacks and widespread exploitation. Additionally, compromised systems could be used as pivot points for lateral movement within networks, further escalating the impact. The vulnerability threatens organizations across industries adopting AI automation and workflow orchestration, especially those integrating langflow into production environments.
Mitigation Recommendations
Immediate upgrade to langflow version 1.8.0 or later is the primary mitigation step to remove the hardcoded allow_dangerous_code=True setting. Until upgrade is possible, organizations should restrict network access to langflow instances, especially limiting exposure to untrusted networks. Implement strict input validation and sanitization on any user-supplied data that interacts with langflow workflows. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) with custom rules to detect and block suspicious prompt injection patterns targeting the Python REPL. Monitor logs for unusual command execution or unexpected Python code activity. Conduct regular security audits of AI workflow tools and maintain an inventory of versions deployed. Consider isolating langflow environments using containerization or sandboxing to limit potential damage from exploitation.
Affected Countries
United States, Germany, United Kingdom, Canada, France, Japan, South Korea, Australia, Netherlands, India
CVE-2026-27966: CWE-94: Improper Control of Generation of Code ('Code Injection') in langflow-ai langflow
Description
CVE-2026-27966 is a critical remote code execution vulnerability in langflow versions prior to 1. 8. 0. The flaw arises because the CSV Agent node hardcodes allow_dangerous_code=True, exposing LangChain’s Python REPL tool. This allows attackers to execute arbitrary Python and OS commands via prompt injection without authentication or user interaction. The vulnerability has a CVSS score of 9. 8, indicating high impact on confidentiality, integrity, and availability. Although no known exploits are currently in the wild, unpatched systems remain at significant risk. Version 1. 8.
AI-Powered Analysis
Technical Analysis
CVE-2026-27966 is a critical vulnerability classified under CWE-94 (Improper Control of Generation of Code) affecting langflow, a tool used to build and deploy AI-powered agents and workflows. Prior to version 1.8.0, the CSV Agent node in langflow hardcodes the parameter allow_dangerous_code=True. This setting exposes LangChain’s Python REPL tool (python_repl_ast), which is designed to evaluate Python code dynamically. Because this REPL is exposed without restrictions, an attacker can leverage prompt injection techniques to execute arbitrary Python code and underlying operating system commands on the server hosting langflow. The vulnerability requires no authentication or user interaction, making it remotely exploitable over the network. The impact includes full remote code execution (RCE), allowing attackers to compromise confidentiality, integrity, and availability of the affected system. The vulnerability was publicly disclosed on February 26, 2026, with a CVSS v3.1 base score of 9.8, reflecting its critical severity. Although no known exploits have been observed in the wild yet, the ease of exploitation and the critical nature of the flaw necessitate immediate remediation. The issue is fixed in langflow version 1.8.0 by removing the hardcoded dangerous code execution flag, thereby preventing exposure of the Python REPL tool.
Potential Impact
The vulnerability enables attackers to execute arbitrary code remotely on servers running vulnerable versions of langflow, potentially leading to complete system compromise. This can result in unauthorized data access, data manipulation, destruction of data, and disruption of AI workflows. Organizations relying on langflow for AI agent deployment may face operational downtime, loss of intellectual property, and exposure of sensitive information. The critical severity and lack of authentication requirements increase the risk of automated attacks and widespread exploitation. Additionally, compromised systems could be used as pivot points for lateral movement within networks, further escalating the impact. The vulnerability threatens organizations across industries adopting AI automation and workflow orchestration, especially those integrating langflow into production environments.
Mitigation Recommendations
Immediate upgrade to langflow version 1.8.0 or later is the primary mitigation step to remove the hardcoded allow_dangerous_code=True setting. Until upgrade is possible, organizations should restrict network access to langflow instances, especially limiting exposure to untrusted networks. Implement strict input validation and sanitization on any user-supplied data that interacts with langflow workflows. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) with custom rules to detect and block suspicious prompt injection patterns targeting the Python REPL. Monitor logs for unusual command execution or unexpected Python code activity. Conduct regular security audits of AI workflow tools and maintain an inventory of versions deployed. Consider isolating langflow environments using containerization or sandboxing to limit potential damage from exploitation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-02-25T03:24:57.793Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 699fabd8b7ef31ef0b7dea23
Added to database: 2/26/2026, 2:11:36 AM
Last enriched: 2/26/2026, 2:26:01 AM
Last updated: 2/26/2026, 4:18:06 AM
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-2506: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in motahar1 EM Cost Calculator
MediumCVE-2026-2499: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in tgrk Custom Logo
MediumCVE-2026-2498: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in bulktheme WP Social Meta
MediumCVE-2026-2489: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in readymadeweb TP2WP Importer
MediumCVE-2026-2029: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in livemesh Livemesh Addons for Beaver Builder
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.