Skip to main content
Meet us at Black Hat USA 2026— Las Vegas, August 1–6Book a Meeting
Mallory
Back to intelligence
ai-platform-securityopen-source-dependency-vulnerabilityproof-of-concept-release

PraisonAI Sandbox Bypasses Enabled Arbitrary Code Execution in Agent Python Tools

Updated 3mo agoFirst seen Apr 8, 20262 sources

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.

Share:
PraisonAI Sandbox Bypasses Enabled Arbitrary Code Execution in Agent Python Tools
Stay ahead

Get ahead of threats like this

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.

EVENT TIMELINE

How this story unfolded

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

2 EVENTS
Apr 10, 20263mo 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__.

Apr 8, 20263mo 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.

1 LINKEDOpen in app
Affected products
1 linked
Praisonai
The operational view lives in Mallory

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, which detections to deploy, and what to do next.
Exposure mapping

Map indicators from this story to your assets and identify affected systems in minutes.

Threat actor evidence

Every observed campaign, victim, and pivot linked to actors named in this story.

Associated malware

Malware, exploits, and IOCs connected to the activity described here.

Detection signatures

YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.

Scheduled alerts

Get matching new stories delivered to your team as they break — not the next morning.

AI threads

Ask questions about this story and take action on the answers.