Executive brief
PraisonAI is a Node.js package that provides sandboxed command execution with allowlist controls, intended to safely run AI-generated shell commands. The vulnerability allows attackers to bypass the command allowlist by appending shell metacharacters (e.g., semicolons or pipes) after an allowed command, causing the shell to execute arbitrary unauthorized commands with the privileges of the PraisonAI process.
Technical details
The vulnerability is an authorization bypass in the CommandValidator and SandboxExecutor components. CommandValidator.validate() checks only the first whitespace-delimited token of a command string against the allowedCommands list, but SandboxExecutor.spawn() passes the entire unmodified command string to spawn('sh', ['-c', command]). This creates a mismatch: a command like "echo allowed; cat /tmp/marker" passes validation (because "echo" is allowlisted) but the shell interprets the entire string as a script, executing both echo and the non-allowlisted cat. The denylist blocks only specific patterns like "; rm" but does not reject shell metacharacters (;, &&, ||, backticks, $()) as a general boundary. An attacker with the ability to influence command strings sent to SandboxExecutor can inject arbitrary shell commands and execute them with the process's privileges. Patched versions (>= 1.7.2) reject shell metacharacters before execution.
Affected products
- PraisonAI praisonai >=1.2.3, <=1.7.1
Timeline
- 2026-06-17: disclosed
- 2026-06-18: patched: Version 1.7.2 and later