PraisonAI Template Injection Vulnerability in Agent Tool Definitions

Vulnerability

A template injection vulnerability has been identified in PraisonAI versions prior to 4.5.115. The issue arises in the create_agent_centric_tools() function, which returns tools that process file content using template rendering. When user input from agent.start() is directly passed into these tools without proper escaping, template expressions are executed instead of being treated as plain text. This vulnerability allows for arbitrary code execution by injecting malicious template expressions through agent instructions, exploiting the lack of input sanitization and context-aware escaping in the tools.

Impact

Exploitation of this vulnerability allows for arbitrary command execution on the host system with the privileges of the running process. This could lead to data theft, deployment of ransomware, or lateral movement within a network.

Reproduction

To reproduce this vulnerability, use an agent instruction that includes a template expression, such as one that executes a system command. The expression will be processed and executed instead of being treated as literal text, confirming successful exploitation.

Remediation

Users are advised to update to PraisonAI version 4.5.115 or later. Additionally, implement input sanitization to validate file content, apply contextual escaping to template syntax in user input, restrict template execution environments using secure evaluation modes, and require manual approval for file creation operations in production.

Added: Apr 8, 2026, 9:54 PM
Updated: Apr 8, 2026, 9:54 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
7.4
remediation
0.0
relevance
5.5
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.