Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious workspace with crafted .mcp.json
-
DeliveryVictim opens untrusted workspace in Kimi Code
-
ExploitConfig loader auto-spawns MCP server
-
ExecutionInjected OS command executes as user
-
ImpactAttacker-controlled code runs in developer context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to run Moonshot AI Kimi Code (≤0.31.0) inside an UNTRUSTED workspace that contains an attacker-controlled .mcp.json, which the MCP Configuration Loader auto-spawns before/without a trust confirmation, injecting OS commands. A secondary vector requires the untrusted workspace to plant a bare-name executable (e.g., fd or stty) resolvable via $PATH before confirmation. Limiting factors: the attacker cannot trigger this against a server - a developer must open/operate on the malicious workspace (UI:P/UI:R), the target must be a pre-0.31.1 version, and the fix (absolute-path resolution of fd/stty plus the trust prompt) neutralizes both the auto-spawn and path-planting paths. |
| Impact | The vendor (VulDB) rates this CVSS 4.0 at only 2.1, driven by low sub-scores across the board (VC:L/VI:L/VA:L) and UI:P, yet the underlying flaw is an OS command injection (CWE-78) in the MCP Configuration Loader - a class that normally yields full arbitrary code execution. This is a notable conflict: the CVSS impact metrics understate the technical severity of command injection, which realistically grants arbitrary code execution in the context of the user running Kimi Code. Balancing signals: a public exploit exists (POC=YES, SSVC/CVSS E:P 'Proof-of-Concept'), but there is NO CISA KEV listing and NO EPSS score in the provided data, so there is no evidence of active or widespread exploitation. Crucially, exploitation is gated: it requires a victim to run Kimi Code inside an untrusted workspace containing a malicious .mcp.json that auto-spawns processes (plus a secondary $PATH path-planting vector via bare-name fd/stty binaries). The 'attack may be launched remotely' framing reflects that the malicious repository is delivered remotely, but triggering still depends on the victim opening/operating on that untrusted workspace locally (UI is required). Net: this is a real, patched, publicly-exploitable weakness that matters for developers using AI coding agents on untrusted code, but it is not a mass-exploitation, unauthenticated-server priority - treat as a targeted supply-chain/workspace-trust risk. The vendor's 2.1 score materially understates the impact of a command-injection primitive; verify impact independently. |
| Exploit ScenarioDerived | An attacker publishes a repository (or tricks a developer into cloning one) containing a malicious .mcp.json; when the victim opens that untrusted workspace in Kimi Code ≤0.31.0, the MCP Configuration Loader auto-spawns the attacker-defined server, executing injected OS commands as the developer. A secondary variant plants a bare-name executable (e.g., a fake fd or stty) in the workspace so it is resolved via $PATH before the trust confirmation. A public proof-of-concept exists (linked from VulDB), so exploitation requires little attacker development effort. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 22, 2026
OS command injection in Moonshot AI's Kimi Code (versions 0.31.0 and earlier) lets an attacker-controlled .mcp.json file in an untrusted workspace be auto-spawned by the MCP Configuration Loader before any trust confirmation, executing arbitrary OS commands on the developer's machine. Exploitation requires the victim to open or operate on the malicious workspace (user interaction) and to run a pre-0.31.1 version; publicly available exploit code exists, but there is no confirmed active exploitation (no CISA KEV). Although the vendor rates this CVSS 4.0 at only 2.1, an independent assessment scores it 7.8 (CVSS 3.1, AV:L/AC:L/PR:N/UI:R, C:H/I:H/A:H) because CWE-78 command injection inside an AI agent's configuration loader normally yields full code execution.
RemediationAI
Vendor-released patch: 0.31.1 (upgrade to @moonshot-ai/kimi-code 0.31.1), which enforces the trust prompt before MCP auto-spawn and resolves fd/stty to absolute paths so untrusted workspaces cannot plant bare-name executables on $PATH. Until patching is possible, treat every .mcp.json from an untrusted workspace as executable code: avoid opening untrusted repositories or workspaces with Kimi Code, inspect and remove .mcp.json from cloned projects before launching the agent, and run the agent in an isolated container or low-privilege account with a hardened $PATH so injected commands cannot reach sensitive resources; these workarounds reduce exposure but do not fully neutralize the auto-spawn behavior, so they should be temporary. Because publicly available exploit code exists, prioritize patching over workarounds. Advisory references: https://vuldb.com/vuln/408415 (and its CTI page https://vuldb.com/vuln/408415/cti), plus the patch release https://github.com/MoonshotAI/kimi-code/releases/tag/%40moonshot-ai%2Fkimi-code%400.31.1.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Kimi Code is an AI coding agent/CLI from Moonshot AI that uses the Model Context Protocol (MCP) to load tool-server definitions from a workspace-local .mcp.json file. The vulnerable logic in agent-core-v2/src/agent/mcp/config-loader.ts (component: MCP Configuration Loader) fails to neutralize special elements in MCP configuration values and, in versions up to 0.31.0, resolves helper binaries such as fd and stty by bare name via $PATH while auto-spawning MCP servers before the user trust prompt. This maps to CWE-78 (improper neutralization of special elements used in an OS command) and yields two injection paths: the primary one where a malicious .mcp.json is auto-spawned prior to trust confirmation, injecting OS commands, and a secondary one where an attacker plants bare-name executables (e.g., fd, stty) earlier in $PATH so they are resolved instead of the intended system binaries. The CPE cpe:2.3:a:moonshot_ai:kimi_code:*:*:*:*:*:*:*:* captures the affected product line; the fix in 0.31.1 resolves fd/stty to absolute paths and enforces the trust prompt before auto-spawn. Note that the vendor description labels the attack as remotely launchable, but the independently assessed CVSS 3.1 vector is AV:L/UI:R, meaning an attacker cannot directly trigger it against a server; a developer must open the poisoned workspace.
Know when Kimi Code gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P
OS command injection yields arbitrary code execution as the user (C/I/A:H); AV:L and UI:R because the victim must open a malicious local workspace, and no prior auth is needed (PR:N).
Primary rating from Vendor (VulDB).
CVSS VectorVendor: VulDB
Lifecycle Timeline
3DescriptionCVE.org
A security flaw has been discovered in Moonshot AI Kimi Code up to 0.31.0. The affected element is an unknown function of the file agent-core-v2/src/agent/mcp/config-loader.ts of the component MCP Configuration Loader. The manipulation results in os command injection. The attack may be launched remotely. The exploit has been released to the public and may be used for attacks. Upgrading to version 0.31.1 is sufficient to fix this issue. It is recommended to upgrade the affected component. Beyond the trust prompt, the fix resolves fd/stty binaries to absolute paths specifically "so untrusted workspaces cannot plant bare-name executables before confirmation," fixing a secondary $PATH path-planting vector alongside the primary untrusted-.mcp.json auto-spawn.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
EUVD-2026-84628
GHSA-jp7p-97jq-v89h
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB