Detect PraisonAI Sandbox Escape via print.__self__ Builtins Leak in execute_code in Sumo Logic CSE
Detects exploitation of CVE-2026-47392, a critical sandbox escape vulnerability in PraisonAI (praisonaiagents <= 1.6.39, PraisonAI <= 4.6.39). The flaw allows attackers to leak the Python builtins module through `print.__self__` within the `execute_code` subprocess mode, bypassing sandbox restrictions and achieving arbitrary code execution on the host. A public proof-of-concept is available.
MITRE ATT&CK
Sumo Detection Query
_sourceCategory=*windows* OR _sourceCategory=*linux* OR _sourceCategory=*endpoint*
| where (%"cmdline" matches "*praisonai*" or %"cmdline" matches "*praisonaiagents*")
| where (%"cmdline" matches "*print.__self__*"
or %"cmdline" matches "*__builtins__*"
or %"cmdline" matches "*execute_code*"
or (%"cmdline" matches "*subprocess*" and %"cmdline" matches "*shell=True*"))
| eval risk = if(%"cmdline" matches "*print.__self__*", "BuiltinsLeak", if(%"cmdline" matches "*subprocess*", "ShellEscape", "SuspiciousExec"))
| count by _sourceHost, %"user", %"cmdline", risk
| order by _count desc Sumo Logic query detecting PraisonAI sandbox escape exploitation by searching endpoint log sources for builtins module leak patterns and subprocess shell execution commands.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate PraisonAI agent pipelines that use subprocess for authorized external tool integration
- Developer test environments without sandbox enforcement where builtins access is expected
- Security scanning tools that enumerate Python runtime attributes for vulnerability assessment
- Automated integration tests that exercise PraisonAI's execute_code path with controlled inputs
Other platforms for CVE-2026-47392
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1PraisonAI Builtins Leak via print.__self__ in execute_code
Expected signal: Process spawn: python3 executing praisonaiagents code_tools module; child process executing 'id' command via os.popen; stdout contains 'SANDBOX_ESCAPE_SUCCESS' followed by uid/gid output
- Test 2PraisonAI Sandbox Escape to Reverse Shell
Expected signal: Process tree: python3 -> praisonaiagents -> bash -c 'bash -i' with network connection to 127.0.0.1:4444; network telemetry showing TCP connection from python process
- Test 3PraisonAI Sandbox Escape with Credential File Exfiltration
Expected signal: File open event on /tmp/lab_creds.txt by python process; outbound HTTP POST to 127.0.0.1:8888 from PraisonAI process; process command line contains __builtins__ and os.system invocation
Unlock Pro Content
Get the full detection package for CVE-2026-47392 including response playbook, investigation guide, and atomic red team tests.