/

CVE-2026-57136

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in PraisonAI Sandbox

CVE-2026-57136

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78, CWE-693, CWE-863

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

PraisonAI's sandbox command validation checks only the first executable token while later passing the full input to a shell. An attacker who can influence a command submitted to the sandbox may append shell syntax and execute arbitrary commands with the privileges of the PraisonAI process.

Affected context

The vulnerability occurs in PraisonAI's TypeScript sandbox executor when command validation compares only the initial whitespace-delimited executable with an allowlist, but execution sends the complete command string to sh -c. The risk depends on an untrusted party being able to supply or influence commands and on the process having meaningful permissions or access to sensitive resources.

Exploit preconditions

  • Attack surface: PraisonAI's sandbox command-execution interface
  • Required access: Ability to provide or influence a command passed to the executor
  • Trigger point: Validation followed by shell-based execution of the complete command string
  • Why exploitation is possible: The validator approves the first executable without accounting for appended shell operators or additional commands

Why this happens

The underlying bug is a mismatch between validation and execution semantics. CommandValidator inspects only the first executable token, while SandboxExecutor interprets the entire input through sh -c, allowing shell metacharacters and additional command segments to bypass the intended allowlist. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with related protection and authorization weaknesses represented by CWE-693 and CWE-863.

Potential impact

  • An attacker could execute arbitrary operating-system commands
  • The PraisonAI process could be compromised or abused
  • Sensitive files, credentials, or environment data may be accessed
  • The attacker could modify application data or alter agent behavior
  • Further compromise could occur if the process has excessive system privileges

General mitigation guidance

Mitigation generally focuses on making validation and execution use the same restricted command model.

Common defensive patterns include:

  • Avoiding shell interpretation when executing commands
  • Passing an executable and explicitly validated arguments as separate process parameters
  • Validating the complete command structure rather than only its first token
  • Using a narrowly defined command and argument allowlist with safe-by-default behavior
  • Reducing or eliminating user control over executable commands
  • Running the executor with least-privilege operating-system permissions and isolated filesystem and network access
  • Treating command input as untrusted even when the initial executable is allowlisted

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for sh -c, shell-spawn APIs, and dynamic command construction
  • Code review checks comparing validation logic with the exact execution API
  • Searches for allowlists that inspect only prefixes, first tokens, or executable names
  • Tests containing shell operators and chained command syntax to verify complete-input rejection
  • Policy enforcement that prohibits shell evaluation for user-controlled command strings
  • Automated security review tools that flag command construction and incomplete authorization checks

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/commit/709a0387853709a5e2f2c34680fa64cada252c27
github.comgithub.com/MervinPraison/PraisonAI/releases/tag/v4.6.60
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-vjv9-7m7j-h833

Frequently asked

questions

Exploitability depends on how the PraisonAI sandbox is exposed. It may be remotely exploitable when an external or untrusted user can influence commands submitted to an accessible service or workflow.

The attacker generally needs the ability to provide or modify command input accepted by the sandbox executor. The resulting impact depends on the privileges and reachable resources of the PraisonAI process.

Avoid invoking a shell for untrusted command input. Execute only explicitly approved programs with separately validated arguments, and ensure validation covers the complete command structure.

Use safe process-spawning APIs, minimize command functionality, apply least privilege, and test validation against shell metacharacters, chaining, redirection, and substitution syntax.

Find out what's already
exploitable in your codebase.