GHSA-vjv9-7m7j-h833
## Summary The published npm package `praisonai` exports `SandboxExecutor`, `CommandValidator`, and `sandboxExec` as "safe command execution with restrictions." When `allowedCommands` is configured, `CommandValidator` checks only the first whitespace-delimited token of the command string. `SandboxExecutor` then passes the entire original string to `spawn("sh", ["-c", command])`. With a policy that allows only `echo`, this direct command is correctly rejected: ```sh cat /tmp/marker ``` but this chained command is accepted and executed: ```sh echo allowed; cat /tmp/marker ``` The shell executes `cat` even though `cat` is not allowlisted. This bypasses the command allowlist and can execute arbitrary shell commands with the PraisonAI process privileges when an application, CLI workflow, or agent pipeline exposes sandbox command execution to lower-trust users, prompts, or model output. The PoV is deterministic and local-only. It creates and reads only a temporary marker file. ## Technical Details In `src/praisonai-ts/src/cli/features/sandbox-executor.ts`, `CommandValidator.validate()` normalizes the command and authorizes only the first whitespace token: ```ts const normalized = command.toLowerCase().trim(); if (this.allowedCommands) { const baseCmd = normalized.split(/\s+/)[0]; if (!this.allowedCommands.includes(baseCmd)) { return { valid: false, reason: `Command '${baseCmd}' not in allowlist` }; } } ``` The denylist does not generally reject shell separators. It blocks a few specific patterns such as `; rm`, but not `; cat`, `&&`, `||`, backticks, `$()`, or newline as a general policy boundary. `SandboxExecutor.spawn()` then executes the unmodified command string through a shell: ```ts const proc = spawn('sh', ['-c', command], { cwd: this.config.cwd, env, timeout: this.config.timeout, stdio: ['pipe', 'pipe', 'pipe'] }); ``` That creates a mismatch: the allowlist authorizes one command token, but the shell interprets the whole string as
Properties
- ghsa_id
- GHSA-vjv9-7m7j-h833
- summary
- npm PraisonAI SandboxExecutor allowedCommands bypass via shell chaining
- severity
- high
- cvss_score
- 8.8
- cve_id
- GHSA-vjv9-7m7j-h833
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- is_ghsa_only
- true
- ghsa_published
- 2026-06-18T14:26:34Z
- source_url
- https://github.com/advisories/GHSA-vjv9-7m7j-h833
- ghsa_updated
- 2026-06-18T14:26:35Z
Related Entities (6)
AFFECTS (1)
HAS_WEAKNESS (3)
REPORTED_BY (1)
VULNERABLE_TO (1)
Explore deeper with Ninja Signal's threat intelligence graph