llm Code Injection Vulnerability in CLI Tool Allowing Arbitrary Code Execution
Vulnerability
A critical code injection vulnerability has been identified in the llm CLI tool, affecting versions through 0.27.1. The vulnerability arises from the --functions command-line argument, which allows users to provide custom Python function definitions. However, the tool executes the supplied code using the unsafe exec() function without any sanitization, sandboxing, or security restrictions. This flaw can be exploited by crafting a malicious llm command that includes arbitrary Python code in the --functions argument and using social engineering to persuade a victim to execute it, leading to unauthorized code execution on the victim's system, potentially giving the attacker full control.
Impact
Exploitation of this vulnerability allows for arbitrary code execution on the victim's system, potentially granting the attacker full control.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
