CVE-2026-47392 Splunk · SPL

Detect PraisonAI Sandbox Escape via print.__self__ Builtins Leak in execute_code in Splunk

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

Tactic
Execution Privilege Escalation Lateral Movement

SPL Detection Query

Splunk (SPL)
spl
index=* sourcetype IN ("WinEventLog:Security", "linux_secure", "osquery:results", "sysmon") 
("praisonai" OR "praisonaiagents")
| eval suspicious_args = if(match(cmdline, "print\.__self__|__builtins__|execute_code|__import__\s*\("), 1, 0)
| eval shell_exec = if(match(cmdline, "os\.system|subprocess\.Popen|subprocess\.run|os\.popen"), 1, 0)
| eval risk_score = suspicious_args * 60 + shell_exec * 40
| where risk_score > 0
| eval severity = case(risk_score >= 80, "critical", risk_score >= 60, "high", risk_score >= 40, "medium", true(), "low")
| table _time, host, user, cmdline, parent_cmdline, suspicious_args, shell_exec, risk_score, severity
| sort -risk_score
critical severity high confidence

Splunk detection for PraisonAI sandbox escape exploitation, scoring events based on presence of builtins leak patterns and subsequent shell execution commands.

Data Sources

Windows Security Event LogSysmonLinux Auditosquery

Required Sourcetypes

WinEventLog:Securitylinux_secureosquery:resultssysmon

False Positives & Tuning

  • Legitimate PraisonAI installations running developer-mode code with intentional introspection
  • Python testing frameworks that enumerate builtins as part of code analysis pipelines
  • Security tooling that inspects Python runtime environments for compliance checks
  • Developers debugging PraisonAI agent sandbox restrictions in non-production environments

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.

  1. 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

  2. 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

  3. 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.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections