/

CVE-2026-61438

Severity:

HIGH RISK

(7.3)

OS Command Injection (CWE-78) in PraisonAI Workflow Engine

CVE-2026-61438

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.3)

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 before version 4.6.78 contains an OS command injection flaw in the JobWorkflowExecutor inline Python execution path.

Malicious workflow YAML files can embed Python code that imports system modules and invokes shell commands, allowing attackers to execute arbitrary OS commands with the workflow process privileges.

Affected context

This vulnerability affects PraisonAI deployments that use YAML-defined workflows executed through JobWorkflowExecutor._exec_inline_python().

The issue becomes relevant when workflow definitions can be created, modified, or uploaded by users or external systems without strict trust or validation guarantees.

Environments where inline Python steps are evaluated with insufficient AST-level checks, and where workflow processes run with meaningful system or application privileges, are particularly exposed.

Exploit preconditions

  • Attack surface: Workflow definition interface (e.g., YAML workflow files stored in a repository, uploaded via APIs, or configured through UI).
  • Required access: Ability to author or modify workflow YAML files that PraisonAI will execute.
  • Trigger point: Execution of an inline Python step by JobWorkflowExecutor._exec_inline_python() during workflow processing.
  • Why exploitation is possible: AST validation of the Python snippet is incomplete, allowing imports such as os and calls like os.system() to bypass sandbox restrictions and run arbitrary OS commands.

Why this happens

The underlying bug stems from insufficient validation and restriction of dynamically supplied Python code executed as part of workflow steps.

While an AST-based inspection is used, it does not fully constrain dangerous constructs, such as module imports and process execution APIs, which maps directly to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

Conceptually, the execution environment trusts user-controlled workflow scripts and treats them as benign automation logic, instead of strictly sandboxing or confining them to a safe subset of operations.

Potential impact

  • Attackers can execute arbitrary OS commands with the privileges of the PraisonAI workflow process.
  • System compromise through installation of backdoors, modification of files, or exfiltration of sensitive data.
  • Lateral movement within the hosting environment by probing network services and credentials accessible to the workflow runtime.
  • Disruption of service availability via destructive commands, resource exhaustion, or shutdown of critical components.

General mitigation guidance

Mitigation generally centers on constraining and hardening the execution of user-supplied automation logic.

Recommended defense patterns include:

  • Enforcing strict AST-based whitelisting of allowed Python constructs and banning imports of sensitive modules (e.g., os, subprocess, sys, socket).
  • Treating workflow scripts as untrusted input and executing them in a well-defined sandbox with restricted APIs, resources, and no direct shell or OS command access.
  • Designing a declarative workflow DSL instead of arbitrary code execution, limiting available operations to vetted actions.
  • Running workflow executors with least-privilege OS accounts and isolating them using OS-level controls such as containers, seccomp profiles, or dedicated restricted environments.

How teams detect issues like this

Effective detection focuses on both code-level patterns and runtime behavior:

  • Static analysis and code review to identify any paths that execute user-controlled Python or shell commands without strong validation or sandboxing.
  • Rules that flag use of dangerous modules and APIs in inline execution contexts (e.g., os.system, subprocess.Popen, eval, exec) and ensure they are never reachable from workflow input.
  • Security policies in CI/CD that enforce defensive patterns around automation scripting features and prevent reintroduction of unsafe execution paths.
  • Runtime monitoring and logging for unexpected command executions, abnormal child processes, or suspicious workflow behavior, optionally integrated with automated alerting or anomaly detection tools.

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-26mh-57q7-jfvr
vulncheck.comvulncheck.com/advisories/praisonai-before-remote-code-execution-via-broken-ast-sandbox

Frequently asked

questions

Exploitability depends on who can create or modify workflows. In environments where workflow YAML files are user-facing or integrated with external systems, the attack surface can be significant; in tightly controlled internal deployments, the risk is more constrained.

An attacker must be able to supply or alter workflow definitions that PraisonAI will process. This might involve authenticated access to the workflow configuration interface, control over a connected repository, or compromise of a system that generates workflows.

The safest approach is to avoid executing arbitrary user-controlled code altogether. Where automation is needed, use a declarative workflow language or a restricted command set, coupled with strong AST-based or interpreter-level sandboxing that forbids imports and OS command APIs.

Preventing similar issues involves designing workflow engines with untrusted-input assumptions, enforcing strict boundaries around dynamic code, using static and runtime safeguards for dangerous APIs, and embedding secure-by-default patterns into the architecture and review processes for any scripting or automation features.

Find out what's already
exploitable in your codebase.