CVE-2026-34955: Praisonai PraisonAI Has Sandbox Escape Vulnerability

HIGH
Advisory Identifier: GHSA-r4f2-3m54-pp7q
CVSS 8.8
CWE-78
Published
Advisory Summary

CVE-2026-34955 is a HIGH (CVSS 8.8) praisonai has sandbox escape vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Praisonai libraries in the PyPI ecosystem. The issue involves praisonai has sandbox escape via shell=true and bypassable blocklist in subprocesssandbox. Remediation is available by upgrading affected packages to version 4.5.97.

CVE-2026-34955 at a Glance

CVE Identifier CVE-2026-34955
GHSA Identifier GHSA-r4f2-3m54-pp7q
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Praisonai
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-34955

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.

praisonai fixed: 4.5.97
pip install praisonai>=4.5.97
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show praisonai

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-34955, inspect your installed packages using pip:

pip show praisonai

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 4.5.97), your application is affected.

Note: The pip show praisonai command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. 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

### Summary `SubprocessSandbox` in all modes (BASIC, STRICT, NETWORK_ISOLATED) calls `subprocess.run()` with `shell=True` and relies solely on string-pattern matching to block dangerous commands. The blocklist does not include `sh` or `bash` as standalone executables, allowing trivial sandbox escape in STRICT mode via `sh -c '<command>'`. ### Details `sandbox_executor.py:179` (source) -> `sandbox_executor.py:326` (sink) ```python # source -- string-pattern blocklist, sh and bash not in blocked_commands cmd_name = Path(parts[0]).name if cmd_name in self.policy.blocked_commands: # sh, bash not blocked raise SecurityError(...) dangerous_patterns = [ ("| sh", ...), # requires space -- "id|bash" evades this ("| bash", ...), # requires space ] # sink -- shell=True spawns /bin/sh regardless of sandbox mode result = subprocess.run( command, shell=True, ... ) ``` ### PoC ```python # tested on: praisonai==4.5.87 (source install) # install: pip install -e src/praisonai import sys sys.path.insert(0, 'src/praisonai') from praisonai.cli.features.sandbox_executor import SubprocessSandbox, SandboxPolicy, SandboxMode policy = SandboxPolicy.for_mode(SandboxMode.STRICT) sandbox = SubprocessSandbox(policy=policy) result = sandbox.execute("sh -c 'id'") print(result.stdout) # expected output: uid=1000(narey) gid=1000(narey) groups=1000(narey)... ``` ### Impact Users who deploy with `--sandbox strict` have no meaningful OS-level isolation. Any command blocked by the policy (curl, wget, nc, ssh) is trivially reachable via `sh -c '<blocked_command>'`. Combined with agent prompt injection, an attacker can escape the sandbox and reach the network, filesystem, and cloud metadata services. ### Suggested Fix ```python import shlex result = subprocess.run( shlex.split(command), shell=False, cwd=cwd, env=env, capture_output=capture_output, text=True, timeout=timeout ) ```

CVE-2026-34955 Affected Praisonai Versions

1 component(s)
Fixed Versions:
4.5.97
Product / Package Ecosystem Affected Versions Fixed Version
praisonai
PyPI
< 4.5.97
4.5.97

References

Frequently Asked Questions

What is CVE-2026-34955?
CVE-2026-34955 is a security vulnerability in Praisonai involving PraisonAI Has Sandbox Escape via shell=True and Bypassable Blocklist in SubprocessSandbox under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Praisonai versions are affected?
Affected versions include releases prior to 4.5.97 across affected packages: praisonai.
What version fixes CVE-2026-34955?
Upgrading to 4.5.97 (or the latest patched release for your respective branch) resolves the vulnerability.
Is praisonai affected?
Yes, praisonai is affected in releases prior to 4.5.97. Upgrade your dependency to 4.5.97 or later.
What is the CVSS score of CVE-2026-34955?
CVE-2026-34955 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-34955?
CVE-2026-34955 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-34955?
Run the dependency tree command: 'pip show praisonai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r4f2-3m54-pp7q",
  "modified" : "2026-04-06T22:54:33Z",
  "published" : "2026-04-01T23:26:01Z",
  "aliases" : [ "CVE-2026-34955" ],
  "summary" : "PraisonAI Has Sandbox Escape via shell=True and Bypassable Blocklist in SubprocessSandbox",
  "details" : "### Summary\n\n`SubprocessSandbox` in all modes (BASIC, STRICT, NETWORK_ISOLATED) calls `subprocess.run()` with `shell=True` and relies solely on string-pattern matching to block dangerous commands. The blocklist does not include `sh` or `bash` as standalone executables, allowing trivial sandbox escape in STRICT mode via `sh -c '<command>'`.\n\n### Details\n\n`sandbox_executor.py:179` (source) -> `sandbox_executor.py:326` (sink)\n```python\n# source -- string-pattern blocklist, sh and bash not in blocked_commands\ncmd_name = Path(parts[0]).name\nif cmd_name in self.policy.blocked_commands:  # sh, bash not blocked\n    raise SecurityError(...)\ndangerous_patterns = [\n    (\"| sh\",   ...),   # requires space -- \"id|bash\" evades this\n    (\"| bash\", ...),   # requires space\n]\n\n# sink -- shell=True spawns /bin/sh regardless of sandbox mode\nresult = subprocess.run(\n    command,\n    shell=True,\n    ...\n)\n```\n\n### PoC\n```python\n# tested on: praisonai==4.5.87 (source install)\n# install: pip install -e src/praisonai\nimport sys\nsys.path.insert(0, 'src/praisonai')\nfrom praisonai.cli.features.sandbox_executor import SubprocessSandbox, SandboxPolicy, SandboxMode\n\npolicy = SandboxPolicy.for_mode(SandboxMode.STRICT)\nsandbox = SubprocessSandbox(policy=policy)\n\nresult = sandbox.execute(\"sh -c 'id'\")\nprint(result.stdout)\n# expected output: uid=1000(narey) gid=1000(narey) groups=1000(narey)...\n```\n\n### Impact\n\nUsers who deploy with `--sandbox strict` have no meaningful OS-level isolation. Any command blocked by the policy (curl, wget, nc, ssh) is trivially reachable via `sh -c '<blocked_command>'`. Combined with agent prompt injection, an attacker can escape the sandbox and reach the network, filesystem, and cloud metadata services.\n\n### Suggested Fix\n```python\nimport shlex\n\nresult = subprocess.run(\n    shlex.split(command),\n    shell=False,\n    cwd=cwd,\n    env=env,\n    capture_output=capture_output,\n    text=True,\n    timeout=timeout\n)\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "praisonai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.97"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.96"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-r4f2-3m54-pp7q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34955"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MervinPraison/PraisonAI"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T23:26:01Z",
    "nvd_published_at" : "2026-04-04T00:16:19Z"
  }
}