🛡️ CVE-2026-57136 — praisonai
Description
npm PraisonAI SandboxExecutor allowedCommands bypass via shell chaining
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 a script.
The published npm:[email protected] dist files preserve the same behavior:
dist/cli/features/sandbox-executor.jschecks onlybaseCmd.dist/cli/features/sandbox-executor.jslater invokesspawn("sh", ["-c", command]).dist/index.jsexportsSandboxExecutor,CommandValidator, andsandboxExec.
Why This Is Not Intended Behavior
PraisonAI's sandbox docs describe sandbox execution as a security feature for AI-generated commands, with command validation, resource limits, path restrictions, network isolation, and execution isolation. The TypeScript source also describes this component as "Safe command execution with restrictions."
With allowedCommands: ["echo"], PraisonAI correctly rejects cat <marker> when submitted directly. That proves the intended policy is to block non-allowlisted executables. The same policy allowing echo allowed; cat <marker> is therefore an authorization bypass, not merely a permissive configuration.
PoV
Run from a local reproduction checkout:
```bash
node poc/pov_poc.js 1.7.1
```
Expected output includes:
```json
{
"version": "1.7.1",
"package": "npm:praisonai",
"allowedCommands": ["echo"],
"controls": {
"directCatRejected": true,
"benignEchoAllowed": true,
"patchedControlRejectsChainedShell": true
},
"observed": {
"directPolicy": {
"allowed": false,
"reason": "Command 'cat' not in allowlist"
},
"benignPolicy": {
"allowed": true
},
"chainedPolicy": {
"allowed": true
},
"chainedRun": {
"success": true,
"stdout": "allowed\npoc.7.1",
"stderr": "",
"exitCode": 0
},
"patchedControl": {
"benign": {
"allowed": true
},
"direct": {
"allowed": false,
"reason": "Command 'cat' not in allowlist"
},
"chained": {
"allowed": false,
"reason": "shell metacharacter rejected before execution"
}
}
},
"vulnerable": true
}
```
Interpretation:
- Direct
cat <marker>is rejected by the allowlist. - Benign
echo allowedis accepted. echo allowed; cat <marker>is accepted by the same allowlist and executes the non-allowlistedcat.- A patched-control validator that rejects shell metacharacters before execution blocks the chained command while still allowing benign
echo.
The PoV installs npm:[email protected] into a temporary project, creates a temporary marker file, and reads only that file. It does not contact any live service or execute destructive commands.
PoC
The PoV section above contains the local reproduction command, input, and decisive output.
Impact
If lower-trust users, prompts, or model output can influence a command string sent to SandboxExecutor or sandboxExec, allowedCommands does not enforce the intended command boundary. An attacker can append arbitrary shell commands after an allowed first token
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.
Weakness class
CVE-2026-57136 is classified as CWE-693: Protection Mechanism Failure. A protection exists but does not cover the case at hand, so it can be worked around.
Affected software
CVE-2026-57136 is recorded against 1 package.
- praisonai
Timeline and source
Published on 18 June 2026 and last revised on 20 July 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.
References
Details
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| praisonai | — | — |
References
Similar Threats
- Medium CVE-2026-40112
- High CVE-2026-40113
- High CVE-2026-40114
- Critical CVE-2026-39888
- High CVE-2026-39889
More CVE 2026 advisories
Browse all of CVE 2026 in the advisory index.
Site Security Check
Is praisonai part of your stack?
CVE-2026-57136 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.