{"vuln_id":"GHSA-2763-cj5r-c79m","aliases":["CVE-2026-40088"],"description":"PraisonAI Vulnerable to OS Command Injection","published_at":"2026-04-08T21:52:10Z","modified_at":"2026-11-16T15:43:44Z","first_seen_at":"2026-11-21T19:15:20.298295Z","severity":"critical","severity_source":"ghsa","cvss_score":9.6,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","cwe":["CWE-78"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-2763-cj5r-c79m"},"matched_alias":null,"items":[{"id":2550,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-2763-cj5r-c79m / CVE-2026-40088: PraisonAI Vulnerable to OS Command Injection","summary":"PraisonAI Vulnerable to OS Command Injection\n\nThe `execute_command` function and workflow shell execution are exposed to user-controlled input via agent workflows, YAML definitions, and LLM-generated tool calls, allowing attackers to inject arbitrary shell commands through shell metacharacters.\n\n---\n\n## Description\n\nPraisonAI's workflow system and command execution tools pass user-controlled input directly to `subprocess.run()` with `shell=True`, enabling command injection attacks. Input sources include:\n\n1. YAML workflow step definitions\n2. Agent configuration files (agents.yaml)\n3. LLM-generated tool call parameters\n4. Recipe step configurations\n\nThe `shell=True` parameter causes the shell to interpret metacharacters (`;`, `|`, `&&`, `$()`, etc.), allowing attackers to execute arbitrary commands beyond the intended operation.\n\n---\n\n## Affected Code\n\n**Primary command execution (shell=True default):**\n```python\n# code/tools/execute_command.py:155-164\ndef execute_command(command: str, shell: bool = True, ...):\n    if shell:\n        result = subprocess.run(\n            command,  # User-controlled input\n            shell=True,  # Shell interprets metacharacters\n            cwd=work_dir,\n            capture_output=capture_output,\n            timeout=timeout,\n            env=cmd_env,\n            text=True,\n        )\n```\n\n**Workflow shell step execution:**\n```python\n# cli/features/job_workflow.py:234-246\ndef _exec_shell(self, cmd: str, step: Dict) -> Dict:\n    \"\"\"Execute a shell command from workflow step.\"\"\"\n    cwd = step.get(\"cwd\", self._cwd)\n    env = self._build_env(step)\n    result = subprocess.run(\n        cmd,  # From YAML workflow definition\n        shell=True,  # Vulnerable to injection\n        cwd=cwd,\n        env=env,\n        capture_output=True,\n        text=True,\n        timeout=step.get(\"timeout\", 300),\n    )\n```\n\n**Action orchestrator shell execution:**\n```python\n# cli/features/action_orchestrator.py:445-460\nelif step.action_type == ActionType.SHELL_COMMAND:\n    result = subprocess.run(\n        step.target,  # User-controlled from action plan\n        shell=True,\n        capture_output=True,\n        text=True,\n        cwd=str(workspace),\n        timeout=30\n    )\n```\n\n---\n\n## Input Paths to Vulnerable Code\n\n### Path 1: YAML Workflow Definition\n\nUsers define workflows in YAML files that are parsed and executed:\n\n```yaml\n# workflow.yaml\nsteps:\n  - type: shell\n    target: \"echo starting\"\n    cwd: \"/tmp\"\n```\n\nThe `target` field is passed directly to `_exec_shell()` without sanitization.\n\n### Path 2: Agent Configuration\n\nAgent definitions in `agents.yaml` can specify shell commands:\n\n```yaml\n# agents.yaml\nframework: praisonai\ntopic: Automated Analysis\nroles:\n  analyzer:\n    role: Data Analyzer\n    goal: Process data files\n    backstory: Expert in data processing\n    tasks:\n      - description: \"Run analysis script\"\n        expected_output: \"Analysis complete\"\n        shell_command: \"python analyze.py --input data.csv\"\n```\n\n### Path 3: Recipe Step Configuration\n\nRecipe YAML files can cont\n\nAffected packages: pip:PraisonAI\nPatched: PraisonAI 4.5.121","url":"https://github.com/advisories/GHSA-2763-cj5r-c79m","published_at":"2026-04-08T21:52:10Z","updated_at":"2026-11-16T15:43:44Z","fetched_at":"2026-11-21T19:15:18.416925Z","severity":"critical","cvss_score":9.6,"epss":0.00426,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"PraisonAI","vuln_id":"CVE-2026-40088","vuln_ids":["CVE-2026-40088","GHSA-2763-CJ5R-C79M"],"tags":["ghsa","pip","CWE-78"],"cluster_id":2546,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2550","html":"https://vulnwatch.ve1ve2.com/item/2550"}}]}