← All articles Industry

CVE-2025-62593: Claude Code RCE via Malicious MCP Servers

By Ammar Khan, CEH · October 19, 2026 · CybernytronX Research
CVE-2025-62593: Claude Code RCE via Malicious MCP Servers

In September 2025, Anthropic published a security advisory for CVE-2025-62593, a critical remote code execution flaw in the Claude Code CLI's handling of Model Context Protocol (MCP) server configurations. The vulnerability allows an attacker who can influence an MCP server definition—via a malicious repository, a shared config file, or a compromised marketplace listing—to execute arbitrary commands on the developer's workstation with the privileges of the Claude Code process. Because MCP servers are routinely auto-discovered from project directories, the attack surface extends to any codebase a developer clones. This article breaks down the flaw, the affected versions, the attacker's likely TTPs, and concrete detection and mitigation guidance for security teams deploying AI coding assistants.

Background: What Is CVE-2025-62593?

CVE-2025-62593 is a command injection vulnerability in Anthropic's Claude Code command-line interface, specifically in the component that parses and launches Model Context Protocol (MCP) servers. MCP is an open specification that lets AI assistants connect to external tools and data sources through local or remote servers. Claude Code reads MCP server definitions from configuration files, including project-scoped files that may be committed to a repository.

According to Anthropic's security advisory, the CLI failed to properly sanitize certain fields within an MCP server definition before passing them to a shell. An attacker who can place a crafted MCP configuration in a location the CLI trusts can achieve arbitrary command execution when the developer starts Claude Code in that directory or explicitly enables the server. The advisory assigns a CVSS v3.1 base score of 8.8 (High), reflecting the low attack complexity and the high impact on confidentiality, integrity, and availability of the developer endpoint.

The flaw is tracked in the NVD entry for CVE-2025-62593, which lists the CWE-78 (OS Command Injection) classification. At the time of writing, the vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog, but the exposure is significant because developer workstations frequently hold cloud credentials, source code, and CI tokens.

Affected Versions and Exposure

Anthropic's advisory states that Claude Code versions prior to 1.0.45 are affected. The vendor released a fixed build (1.0.45 and later) that validates MCP server fields and blocks shell metacharacters. Users of the npm package @anthropic-ai/claude-code should verify their installed version with npm list -g @anthropic-ai/claude-code and upgrade using npm install -g @anthropic-ai/claude-code@latest.

Exposure is not limited to individual developers. Organizations that standardize on Claude Code across engineering teams, or that maintain internal MCP server catalogs, inherit the risk. The vulnerability is especially relevant where repositories are cloned from untrusted sources—open-source contributions, vendor samples, or contractor-delivered code—because a malicious .mcp.json or equivalent project-scoped configuration can travel with the repository.

Anthropic advisory: "A flaw in MCP server configuration parsing could allow command execution when a user loads a crafted configuration. Users should upgrade to version 1.0.45 or later." — Anthropic Security Advisories

Attacker TTPs

The most plausible exploitation path maps to MITRE ATT&CK T1190 (Exploit Public-Facing Application) when the MCP server is remote, and to T1059.004 (Command and Scripting Interpreter: Unix Shell) for the local command injection. A typical chain proceeds as follows:

Note that the attacker does not need to compromise Anthropic's infrastructure. The trust boundary is the developer's local configuration and the repositories they choose to open.

Detection

Because the exploit executes locally, network detection is limited; host-based monitoring and configuration auditing are the primary controls. The following Sigma rule detects suspicious child processes spawned by the Claude Code CLI. It is syntactically valid for the Sigma specification and can be converted with sigma convert for Splunk, Elastic, or Sentinel.

title: Suspicious Child Process from Claude Code CLI
id: 8f3c2a1e-5b7d-4c9a-9e21-6d4f0a7b3c55
status: experimental
description: Detects shell or interpreter processes spawned by Claude Code, which may indicate CVE-2025-62593 exploitation.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2025-62593
author: CybernytronX
date: 2025/09/22
logsource:
  category: process_creation
  product: linux
detection:
  selection_parent:
    ParentImage|endswith:
      - '/claude'
      - '/node'
  selection_child:
    Image|endswith:
      - '/sh'
      - '/bash'
      - '/zsh'
      - '/python3'
      - '/curl'
      - '/wget'
  condition: selection_parent and selection_child
falsepositives:
  - Legitimate MCP servers that invoke shell wrappers
level: medium
tags:
  - attack.execution
  - attack.t1059.004

For repositories, a simple pre-commit or CI check can flag MCP configuration files that contain shell metacharacters. The following YARA rule matches common injection patterns inside MCP JSON files:

rule MCP_Config_Command_Injection
{
  meta:
    author = "CybernytronX"
    description = "Detects shell metacharacters in MCP server configuration files"
    reference = "CVE-2025-62593"
  strings:
    $mcp = "mcpServers" ascii nocase
    $inj1 = /[;&|`$]\(/
    $inj2 = /\$\([^)]+\)/
    $inj3 = /`[^`]+`/
  condition:
    $mcp and any of ($inj*)
}

Finally, an audit of developer endpoints should enumerate every MCP configuration file under home and project directories and review the command, args, and env fields for unexpected interpreters or network utilities.

Mitigation

Anthropic's primary remediation is to upgrade to Claude Code 1.0.45 or later. The vendor advisory also recommends reviewing any project-scoped MCP configuration before enabling it and avoiding automatic trust of MCP servers defined in cloned repositories. Where possible, pin the CLI version in developer onboarding scripts and enforce it via endpoint management.

Additional hardening measures:

For teams using remote MCP servers, validate TLS certificates and restrict egress to an allowlist of approved MCP endpoints.

Why This Matters for Defenders

CVE-2025-62593 is a reminder that AI coding assistants are not passive tools—they execute code and load configuration from untrusted sources. The vulnerability class (command injection in configuration parsing) is old, but the delivery mechanism (MCP definitions in repositories) is new and often outside the visibility of traditional AppSec tooling. Security teams should extend their software supply chain controls to include AI assistant configuration files, and they should treat developer workstations as high-value targets given the credentials they hold. The patch is straightforward; the harder problem is inventory and governance of MCP servers across an engineering organization.

Sources

Frequently Asked Questions

Is CVE-2025-62593 being exploited in the wild?

As of the Anthropic advisory publication in September 2025, there were no public reports of active exploitation. However, the vulnerability is trivially exploitable once a malicious MCP configuration is loaded, so organizations should patch proactively rather than wait for KEV listing.

Does this affect the Claude API or Claude.ai web interface?

No. CVE-2025-62593 is specific to the Claude Code CLI and its MCP server handling. The hosted Claude API and web application do not load local MCP configurations and are not affected by this flaw.

What is an MCP server, and why does it create risk?

Model Context Protocol servers let AI assistants call external tools and data sources. Because they are often defined in project files and launched by the CLI, a malicious definition can execute arbitrary commands. Treat MCP configurations as executable code.

How can I detect if my developers are running vulnerable versions?

Query endpoint management or MDM for the installed version of @anthropic-ai/claude-code. Versions below 1.0.45 are vulnerable. Combine this with process telemetry to spot shell processes spawned by the CLI.

Does patching to 1.0.45 fully eliminate the risk?

Patching removes the command injection flaw, but MCP servers still execute code by design. Defense-in-depth—containerization, least privilege, and configuration review—remains necessary.

Are other AI coding assistants affected by similar flaws?

Any assistant that auto-loads configuration from repositories and passes fields to a shell is potentially susceptible. Security teams should audit all such tools in their environment, not just Claude Code.

Need expert help with this?

If your organization is deploying AI coding assistants or MCP servers, CybernytronX can help you assess the risk. Our team offers penetration testing of developer toolchains, SOC build-out with detection engineering for AI-era threats, and Ethereon, our AI-driven threat detection platform. We work with security leaders to turn emerging AI risks into governed, monitored controls. Visit cybernytronx.com/contact.html to discuss an assessment, or learn more about Ethereon at cybernytronx.com/ethereon.html.

AK

Ammar Khan — Founder, CybernytronX

Certified Ethical Hacker (CEH), B.S. Cybersecurity, Google Certified. 5+ years pentesting, creator of Ethereon AI threat detection. Has remediated 50+ environments and recovered 20+ compromised domains. Hire CybernytronX →

← Back to all articles