Skip to main content
Mallory
← Back to News
ai-platform-securityopen-source-dependency-vulnerabilitywidely-deployed-product-advisory

PraisonAI Sandbox Bypasses Enabled Arbitrary Code Execution in Agent Python Tools

Emerging Technology Risk · 2 sources · Updated 5mo ago · First seen Apr 8, 2026

PraisonAI Sandbox Bypasses Enabled Arbitrary Code Execution in Agent Python Tools

Two high-severity vulnerabilities in PraisonAI exposed its Python sandbox protections to bypass, allowing arbitrary code execution when untrusted agent code was run. CVE-2026-39888 affected versions prior to 1.5.115 in praisonaiagents.tools.python_tools.execute_code() when sandbox_mode defaulted to sandbox; the subprocess wrapper relied on a restricted __builtins__ dictionary and an incomplete AST blocklist that omitted frame-traversal attributes including __traceback__, tb_frame, f_back, and f_builtins. By catching an exception and traversing frames, an attacker could recover the real Python builtins from the wrapper frame and invoke exec, defeating the intended sandbox restrictions.

A second flaw, CVE-2026-40158, affected PraisonAI versions prior to 4.5.128 in _execute_code_direct within praisonaiagents/tools/python_tools.py. That sandbox used AST filtering to block dangerous Python attributes, but only inspected ast.Attribute nodes and missed dynamic attribute resolution through built-in mechanisms such as type.__getattribute__. Attackers could therefore reach blocked capabilities such as __subclasses__ through a trampoline technique because the string appeared as an ast.Constant rather than an ast.Attribute, undermining the protection model until the vendor patched the issue in 4.5.128.

Why it matters

Impact assessment

Two high-severity PraisonAI sandbox bypasses allow arbitrary code execution when untrusted agent-supplied Python is executed, directly affecting organizations using PraisonAI to run agent code, automation workflows, or multi-agent tasks. The primary risk is full compromise of the host context running the Python tool, with potential data theft, credential exposure, workflow manipulation, and service disruption.

Severity and scope

  • Affected product: PraisonAI multi-agent teams system.
  • Affected populations: developers, AI platform teams, and enterprises that permit untrusted or semi-trusted agent code execution.
  • Impact type: arbitrary code execution through sandbox escape.
  • Likely consequences: host-level command execution in the Python runtime context, access to local files and secrets available to the process, downstream compromise of connected systems, and operational disruption of AI-driven workflows.
  • Scope of exposure: potentially broad for deployments using vulnerable versions and enabling Python tool execution; exploitation requires the attacker to supply code to the agent execution path.
  • Known exploitation: the provided references describe vulnerabilities and exploit mechanics but do not report confirmed in-the-wild exploitation.

Structured facts

  • Entity: PraisonAI.
  • Product area: praisonaiagents.tools.python_tools.
  • Vulnerability theme: sandbox bypass leading to arbitrary code execution.
  • Trigger condition: running untrusted agent code through Python execution features.
  • Fixed versions: 1.5.115 for CVE-2026-39888 and 4.5.128 for CVE-2026-40158.
New surface, new adversariesTrack how attackers are adapting to this technology.
Track this risk
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

2 events · Apr 8, 2026 – Apr 10, 2026
  1. Apr 10, 20268mo ago

    PraisonAI fixes AST sandbox bypass in version 4.5.128

    PraisonAI disclosed and fixed a separate sandbox bypass vulnerability affecting versions prior to 4.5.128 that could lead to arbitrary code execution when running untrusted agent code. The issue stemmed from incomplete AST filtering that could be bypassed via dynamic attribute resolution such as type.__getattribute__.

  2. Apr 8, 20268mo ago

    PraisonAI fixes sandbox escape in version 1.5.115

    A sandbox escape vulnerability affecting PraisonAI versions prior to 1.5.115 was identified in execute_code() in subprocess mode. The flaw allowed recovery of real Python builtins through exception frame traversal, and it was fixed in version 1.5.115.

Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Affected products

1 linked
Praisonai
Do you run this?Follow how adversaries are adapting to this technology, and where it touches your stack today.
Track This Risk
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.