/

CVE-2026-88755

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in Z.ai ZCode MCP Workspace

CVE-2026-88755

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78, CWE-200, CWE-284, CWE-863

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.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

Z.ai ZCode automatically connects to MCP servers declared in a repository's workspace configuration. Opening a crafted repository may cause unintended server connections and enable arbitrary code execution when the configured MCP server performs unsafe command handling.

Z.ai ZCode automatically connects to MCP servers declared in a repository's workspace configuration. Opening a crafted repository may cause unintended server connections and enable arbitrary code execution when the configured MCP server performs unsafe command handling.

Affected context

The issue occurs in Z.ai ZCode environments that automatically process MCP server declarations from repository workspace configuration. Risk increases when a user opens an untrusted or externally supplied repository and the application treats its MCP configuration as trusted without explicit confirmation, isolation, or policy enforcement.

The issue occurs in Z.ai ZCode environments that automatically process MCP server declarations from repository workspace configuration. Risk increases when a user opens an untrusted or externally supplied repository and the application treats its MCP configuration as trusted without explicit confirmation, isolation, or policy enforcement.

Exploit preconditions

  • Attack surface: Repository opening and workspace configuration processing
  • Required access: The attacker must provide or influence a repository that contains a crafted MCP server declaration
  • Trigger point: Z.ai ZCode automatically establishes a connection to the declared MCP server
  • Why exploitation is possible: Repository-controlled configuration can influence external tool connectivity and potentially reach command-execution behavior without sufficient trust-boundary checks
  • Attack surface: Repository opening and workspace configuration processing
  • Required access: The attacker must provide or influence a repository that contains a crafted MCP server declaration
  • Trigger point: Z.ai ZCode automatically establishes a connection to the declared MCP server
  • Why exploitation is possible: Repository-controlled configuration can influence external tool connectivity and potentially reach command-execution behavior without sufficient trust-boundary checks

Why this happens

The underlying issue is automatic trust of repository-controlled MCP configuration. This creates an unsafe execution path in which opening a workspace can initiate connections to attacker-controlled or unsafe tooling without an adequate user consent, validation, or isolation boundary. When that tooling executes operating-system commands using insufficiently constrained inputs, the behavior maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with related concerns involving information exposure, authorization boundaries, and missing privilege checks.

The underlying issue is automatic trust of repository-controlled MCP configuration. This creates an unsafe execution path in which opening a workspace can initiate connections to attacker-controlled or unsafe tooling without an adequate user consent, validation, or isolation boundary. When that tooling executes operating-system commands using insufficiently constrained inputs, the behavior maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with related concerns involving information exposure, authorization boundaries, and missing privilege checks.

Potential impact

  • An attacker may execute arbitrary code with the privileges of the Z.ai ZCode process
  • Local files, credentials, or development secrets could be exposed
  • The developer workstation or its connected services could be compromised
  • Malicious tooling could modify source code, build artifacts, or repository contents
  • The incident could enable lateral movement into development or CI environments
  • An attacker may execute arbitrary code with the privileges of the Z.ai ZCode process
  • Local files, credentials, or development secrets could be exposed
  • The developer workstation or its connected services could be compromised
  • Malicious tooling could modify source code, build artifacts, or repository contents
  • The incident could enable lateral movement into development or CI environments

General mitigation guidance

Mitigation generally focuses on reducing trust in repository-controlled tool configuration and preventing automatic execution across trust boundaries.

Common defensive patterns include:

  • Require explicit, per-server user consent before establishing MCP connections
  • Treat repository workspace configuration as untrusted input by default
  • Allow only approved servers, commands, and capabilities through policy-based controls
  • Apply strict input validation and safe process-spawning APIs where command execution is required
  • Run MCP integrations with least privilege and isolate them from sensitive host resources
  • Restrict access to credentials, filesystem locations, and network destinations
  • Provide clear warnings when opening repositories that request external tool connections

Mitigation generally focuses on reducing trust in repository-controlled tool configuration and preventing automatic execution across trust boundaries.

Common defensive patterns include:

  • Require explicit, per-server user consent before establishing MCP connections
  • Treat repository workspace configuration as untrusted input by default
  • Allow only approved servers, commands, and capabilities through policy-based controls
  • Apply strict input validation and safe process-spawning APIs where command execution is required
  • Run MCP integrations with least privilege and isolate them from sensitive host resources
  • Restrict access to credentials, filesystem locations, and network destinations
  • Provide clear warnings when opening repositories that request external tool connections

How teams detect issues like this

Organizations can look for:

  • Static analysis rules identifying shell invocation, dynamic process execution, or unsanitized command construction in MCP integrations
  • Code review signals showing automatic activation of repository-defined servers or tools
  • Policies requiring explicit approval for external connections and executable tool capabilities
  • Endpoint and application telemetry recording MCP server launches, child processes, and unusual network destinations
  • Tests that open untrusted repositories and verify that no external connection or command execution occurs without consent

Automated code review and dependency analysis tools may help identify unsafe process execution and missing authorization checks.

Organizations can look for:

  • Static analysis rules identifying shell invocation, dynamic process execution, or unsanitized command construction in MCP integrations
  • Code review signals showing automatic activation of repository-defined servers or tools
  • Policies requiring explicit approval for external connections and executable tool capabilities
  • Endpoint and application telemetry recording MCP server launches, child processes, and unusual network destinations
  • Tests that open untrusted repositories and verify that no external connection or command execution occurs without consent

Automated code review and dependency analysis tools may help identify unsafe process execution and missing authorization checks.

Sources

SourceLink
zai.comzai.com
zcode.comzcode.com
gist.github.comgist.github.com/lkloliver/aac8dcf8a53fc4b3c1b0a5dfbf36ef68
github.comgithub.com/lkloliver/poc/tree/main/CVE-2026-88755

Frequently asked

questions

The attack can begin with a crafted repository supplied through a remote source, but exploitation generally requires a user or automated workflow to open that repository in Z.ai ZCode.

An attacker typically needs the ability to create or influence repository workspace configuration and persuade a victim or workflow to process it.

Treat repository-defined MCP configuration as untrusted, require explicit approval before connections, and isolate approved tools with least-privilege permissions.

Enforce allowlists and policy checks for MCP servers, avoid unsafe command construction, provide clear trust-boundary warnings, and monitor tool launches and child processes.

The attack can begin with a crafted repository supplied through a remote source, but exploitation generally requires a user or automated workflow to open that repository in Z.ai ZCode.

An attacker typically needs the ability to create or influence repository workspace configuration and persuade a victim or workflow to process it.

Treat repository-defined MCP configuration as untrusted, require explicit approval before connections, and isolate approved tools with least-privilege permissions.

Enforce allowlists and policy checks for MCP servers, avoid unsafe command construction, provide clear trust-boundary warnings, and monitor tool launches and child processes.

Find out what's already
exploitable in your codebase.