Back to skill

Security audit

Kimi Websearch

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Kimi/Moonshot web-search helper, with expected external API use but some setup and disclosure caveats.

Install this only if you are comfortable sending search questions to Moonshot/Kimi using your API key. Prefer a locked dependency version, and use the skill deliberately for current web information rather than as a default fallback for every unknown question.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:12
Finding

Unbounded Third-Party Dependency Version

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 12-15
Vulnerability Type: Unbounded dependency version constraint
Risk Level: Medium

yaml
dependencies:
  - name: openai
    type: pip
    version: ">=1.0.0"

Technical Analysis

The Skill permits any version of the openai package at or above version 1.0.0. This lower-bound-only constraint allows future releases to be installed automatically without prior compatibility or security review.

The script imports OpenAI from this dependency and supplies it with the Moonshot API key. Consequently, a compromised or malicious package release permitted by this constraint could execute code within the Skill's process and access the process environment, API credentials, user queries, and network traffic.

This is a supply-chain exposure rather than evidence that the current openai package is malicious.

Attack Path

  1. An attacker compromises the upstream package, its publishing account, or a future release permitted by the version constraint.
  2. The dependency resolver selects and installs the compromised version because it satisfies >=1.0.0.
  3. The Skill imports the installed package when scripts/web_search.py starts.
  4. Malicious package initialization or client logic executes with the privileges of the Skill process.
  5. The compromised dependency reads the available API key or intercepts user queries and API responses.
  6. The data may then be transmitted to an attacker-controlled endpoint, or the dependency may perform other actions allowed to the process.

Impact Assessment

Successful exploitation could expose KIMI_API_KEY or MOONSHOT_API_KEY, user search queries, and returned search content. Arbitrary code could execute with the same filesystem, environment, and network permissions as the Agent process. The dependency does not itself grant elevated operating-system privileges, so the impact remains bounded by the privi ...[truncated 50 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to an exact, reviewed version instead of using a lower-bound-only range.
  • Record resolved transitive dependencies in a lockfile.
  • Require package hashes during installation, such as through a hash-locked requirements file.
  • Retrieve packages only from an explicitly configured and trusted package index.
  • Review changelogs and security advisories before updating the pinned version.
  • Run the Skill in a restricted environment with minimal filesystem access, limited outbound network access, and only the API credential required for the current operation.
  • Rotate the Moonshot API key if a dependency compromise is suspected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares required environment variables and instructs execution of a local Python script, but it does not explicitly constrain tool scope via permissions or allowed-tools metadata. That increases the chance the runtime grants broader capabilities than intended, making secret access and code execution less auditable and easier to misuse if the skill is invoked in unexpected contexts.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation condition is broad: it triggers whenever the user needs online information or whenever the agent lacks enough information to answer. Such generic fallback wording can cause over-invocation across many conversations, unnecessarily exposing network access and API-backed behavior in situations where it may not be needed or appropriate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill metadata and instructions are written to operate in Chinese and do not indicate that output language should follow user preference. This can violate language/locale policy when used with users who did not opt into Chinese responses.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/web_search.py (reported line 11)May include surrounding context.

python
from openai.types.chat.chat_completion import Choice

# Kimi API 的 BASE_URL 和 MODEL_NAME,都是固定的参数,不需要用户修改。
BASE_URL = "https://api.moonshot.cn/v1"
MODEL_NAME = "kimi-k2-turbo-preview"

# 系统提示词

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The CLI description and help strings are presented in Chinese, and the message-building logic also assumes Chinese phrasing such as checking for '请' and '搜索'. This imposes a specific language/locale behavior without any explicit user opt-in or documented language choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code sends the user's question and accumulated messages to a remote API and invokes a web-search tool, but there is no print, prompt, or other user-facing notice at the point of transmission. For code files, outbound network activity that transmits user data should have some visible disclosure unless already clearly communicated elsewhere; this file only contains developer-facing comments and parser help text.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.