Skip to content
Submit incident
AII-1002-50611
ReportedReported by fewer than three independent publishers, with no official finding.

Code execution vulnerability in Langflow PythonCodeTool

Langflow v1.0.12 contained an arbitrary code execution vulnerability in its PythonCodeTool component that executed user-provided Python code without validation. The flaw could allow attackers to execute arbitrary commands on deployed servers.

24 July 2024 Β· Langflow Β· Security and cyberattacks
24 July 2024
AII-1002-506112 sources ↓
Quick facts
Organization
Langflow (subject)
Category
Security and cyberattacks
Source
github.com
Date
24 July 2024
Drafted by
Raidu Incident Detection

What happened

Langflow v1.0.12 contained a code execution vulnerability in its PythonCodeTool component. The tool allowed developers to write arbitrary Python code that would be executed directly on the server without validation using Python's exec() function.

An attacker could craft malicious Python code, such as reading /etc/passwd using os.popen(), which would execute on the deployed server when the LLM application runs in the Playground environment.

Reported impact

Arbitrary code execution on the server hosting the Langflow application could allow attackers to access sensitive files and system resources.

Index analysis

The vulnerability stems from unsafe use of Python's exec() function on user-provided code without sanitization or restriction. The PythonCodeTool passes all user inputs directly to exec() with only global and local namespace parameters, providing no protection against malicious commands.

Classification

Organization
Langflow (subject)
Category
Security and cyberattacks
Industry
IT infrastructure and hosting
Harm status
Potential harm
Intent
Unintentional
Timing
Post-deployment
Harm types
Public interest
Failure modes
Unsafe autonomous behaviour
AI systems
Langflow

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

github.com
https://github.com/langflow-ai/langflow/issues/2908
cve.org
NVD entry