PySpur-Dev pyspur Remote Code Execution Vulnerability in Jinja2 Template Handler
Vulnerability
A critical remote code execution vulnerability exists in PySpur-Dev pyspur versions through 0.1.18. The issue arises in the 'SingleLLMCallNode' function within 'backend/pyspur/nodes/llm/single_llm_call.py', where the 'user_message' argument is improperly sanitized before being processed by the Jinja2 template engine. This flaw allows for the execution of arbitrary code on the server.
Impact
Exploitation of this vulnerability allows for arbitrary code execution on the server where PySpur is running.
Reproduction
To reproduce this vulnerability, create a workflow in PySpur that includes a node of type 'SingleLLMCallNode'. In the 'user_message' configuration, inject a payload that exploits the template rendering process, such as a command that, when executed, opens a reverse shell. Once the workflow is triggered, the injected command will be executed on the server, resulting in a reverse shell connection.
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.
