Back to skill

Security audit

kimi-cli-doc-helper

Security checks for vulnerabilities and agentic risk

Overview

The skill is an on-topic Kimi CLI documentation helper, but it includes copy-paste commands that directly execute remote installer scripts without verification.

Review the installation advice before installing. Prefer a package-manager or pinned release path when available, or download installer scripts for inspection and verification before running them, especially outside an elevated shell. The skill otherwise appears limited to fetching and summarizing Kimi CLI documentation.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:70
Finding

Unverified Remote Bash Installer Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 70
Vulnerability Type: Remote payload retrieval and execution through a shell pipeline
Risk Level: High

Vulnerable Code

bash
curl -LsSf https://code.kimi.com/install.sh | bash

Technical Analysis

This installation instruction downloads a mutable shell script from an external server and immediately sends it to Bash. The payload is neither pinned to a specific version nor authenticated using a cryptographic signature or published checksum. It is also not saved for inspection before execution.

HTTPS provides transport protection but does not establish that the retrieved script is safe. If the hosting server, DNS resolution, publishing credentials, or upstream deployment process is compromised, the command will execute attacker-controlled shell instructions. Because the effective payload remains external to the audited project, its behavior can change after review without any modification to SKILL.md.

Direct remote execution is not required for the Skill's declared documentation-assistance functionality and exceeds the minimum behavior needed to answer installation questions.

Attack Path

  1. A user asks the Skill how to install Kimi CLI.
  2. The Skill reproduces the installation command from its quick reference.
  3. The user runs the command in a terminal.
  4. Bash retrieves the current script controlled by code.kimi.com.
  5. If the remote distribution channel has been compromised or the script has been maliciously replaced, Bash executes the substituted payload without review or integrity verification.
  6. The payload performs arbitrary operations using the invoking user's permissions.

Impact Assessment

A substituted installer can execute arbitrary shell commands with the privileges of the user running it. This may permit access to source code, local files, environment variables, API tokens, SSH material, and other credentials a ...[truncated 442 chars]

Remediation
View remediation

Remediation Suggestions

Remove the pipe-to-shell installation instruction. Prefer a trusted package manager with a version-pinned release, such as a reviewed and explicitly versioned uv package installation.

If a standalone installer must be offered:

  1. Download it to a non-executable file rather than piping it directly into Bash.
  2. Pin the download to an immutable release version.
  3. Publish and verify a SHA-256 checksum over a separate authenticated channel.
  4. Prefer publisher signature verification over checksums alone.
  5. Allow the user to inspect the script before execution.
  6. Execute it without administrative privileges unless a documented operation strictly requires elevation.
  7. Document the files, network access, and configuration changes the installer performs.

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:73
Finding

Unverified Remote PowerShell Installer Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 73
Vulnerability Type: Remote payload retrieval and execution through PowerShell expression evaluation
Risk Level: High

Vulnerable Code

powershell
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression

Technical Analysis

This instruction retrieves mutable PowerShell source from an external URL and passes it directly to Invoke-Expression. Invoke-Expression interprets the response as executable PowerShell code without pinning, signature validation, checksum verification, or prior inspection.

Consequently, control of the remote response is equivalent to control of commands executed in the user's PowerShell session. HTTPS does not mitigate compromise of the publisher, hosting account, deployment pipeline, or signing process. The external script is absent from the audited project and can therefore change independently after the Skill has been reviewed.

Executing remote PowerShell content is not necessary for the declared documentation-helper functionality. Providing this command exposes users to avoidable code-execution risk beyond the minimum privileges and capabilities required by the Skill.

Attack Path

  1. A Windows user requests Kimi CLI installation guidance.
  2. The Skill provides the documented PowerShell command.
  3. The user executes it.
  4. Invoke-RestMethod downloads the current contents of install.ps1.
  5. Invoke-Expression immediately evaluates the response as PowerShell code.
  6. If the remote source or delivery infrastructure has been compromised, the substituted code runs with the permissions and accessible resources of the PowerShell process.

Impact Assessment

A malicious replacement payload can run arbitrary PowerShell commands under the invoking user's security context. It may read accessible files and credentials, modify user settings, download additional payloads, or create persistence ...[truncated 334 chars]

Remediation
View remediation

Remediation Suggestions

Remove the Invoke-RestMethod | Invoke-Expression pattern. Prefer a version-pinned package distributed through a trusted package manager.

If a PowerShell installer remains necessary:

  1. Download it to a local file without evaluating the response.
  2. Pin it to an immutable release and expected version.
  3. Require an Authenticode signature from a documented publisher and validate it with Get-AuthenticodeSignature.
  4. Verify a separately published cryptographic checksum.
  5. Permit review of the downloaded script before execution.
  6. Run it in a non-elevated session unless specific documented steps require administrator access.
  7. Avoid Invoke-Expression; invoke the verified local script explicitly under an appropriate execution policy.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

External Script Fetching

High
Category
Supply Chain
Confidence
97% confidence
Finding

The skill includes a direct 'curl ... | bash' installation command and a PowerShell equivalent that executes remotely fetched code without prior verification. This is dangerous because users may copy-paste it verbatim, allowing compromise if the remote host, TLS path, or served script is malicious or altered. The skill context increases danger because it is framed as authoritative documentation guidance, which encourages trust and execution.

Content

Scanner excerpt · SKILL.md (reported line 70)May include surrounding context.

Installation

bash
# Linux / macOS
curl -LsSf https://code.kimi.com/install.sh | bash

# Windows (PowerShell)
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression

Chaining Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

The shell chaining pattern '| bash' is a classic unsafe execution primitive because it removes the opportunity to review content before execution and normalizes insecure operational behavior. In an assistant skill, presenting this as quick reference materially increases the chance that users will run untrusted network content directly in a shell, potentially resulting in arbitrary code execution.

Content

Scanner excerpt · SKILL.md (reported line 70)May include surrounding context.

Installation

bash
# Linux / macOS
curl -LsSf https://code.kimi.com/install.sh | bash

# Windows (PowerShell)
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation condition 'User asks about terminal AI assistants for coding' is much broader than the Kimi CLI-specific scope of this skill. It could cause the skill to trigger on generic questions about other coding assistants, leading to unintended invocation outside its documented purpose.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The phrase 'Answering questions where Kimi CLI is part of the solution' does not clearly define how central Kimi CLI must be for activation. This ambiguity can cause the skill to activate whenever Kimi CLI is only tangentially relevant, increasing accidental matches.

Content

No source excerpt is available for this finding.

Behavior Manipulation

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Subtle instructions detected that may alter agent decision-making or introduce hidden biases.

Content

Scanner excerpt · SKILL.md (reported line 100)May include surrounding context.

md
## Notes

- Always prefer official documentation over general knowledge
- If documentation is unclear or missing, say so and suggest checking the GitHub repo
- Keep answers concise but complete
- Kimi CLI is a product of Moonshot AI (月之暗面)