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.
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
Sources and evidence
This record was researched and written by the Index, based on the following original reporting.