Back to skill

Security audit

kuai-shou-trend-insights

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated Kuaishou public-data purpose, but it needs review because it tells users to print a private API token and automatically saves fetched results locally.

Review this before installing if the API token has billing or account value. Do not run `echo $GUAIKEI_API_TOKEN`; use a presence-only check instead, and rotate the token if it has already been printed. Expect your search terms, Kuaishou URLs, request parameters, and returned datasets to be sent to Guaikei and saved under the local `logs/` directory after successful runs.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:271
Finding

API Token Disclosure Through Unsafe Troubleshooting Instruction

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:271
Vulnerability Type: Sensitive credential exposure through terminal output
Risk Level: Medium

Vulnerable code snippet:

sh
echo $GUAIKEI_API_TOKEN

Technical Analysis

The troubleshooting instructions recommend printing the complete value of the GUAIKEI_API_TOKEN environment variable. This token is a sensitive credential used to authenticate requests to the third-party API.

Printing it exposes the secret to the terminal, captured standard output, agent conversation transcripts, command-execution logs, CI/CD logs, screen-sharing sessions, shell recording systems, and any monitoring service that collects process output. The instruction is unnecessary because token presence and basic format can be verified without revealing its value.

The application itself sends the token to the fixed, documented www.guaikei.com service over HTTPS, which is necessary for its declared API functionality. The confirmed issue is specifically the instruction to reveal the full token through echo, not the authenticated HTTPS API request.

Attack Path

  1. A user or agent encounters the documented startup or authentication failure.
  2. The user or agent follows the troubleshooting instruction and executes echo $GUAIKEI_API_TOKEN.
  3. The complete API token is written to terminal output.
  4. The output is retained in an agent transcript, execution log, CI log, terminal recording, or other observable channel.
  5. An attacker with access to that channel extracts the token.
  6. The attacker reuses the token against the Guaikei API until it expires or is revoked.

This path does not grant local operating-system privileges. It grants whatever API access, quota, data retrieval capabilities, and billing impact are associated with the compromised token.

Impact Assessment

Successful exploitation may result in:

  • Unauthorized use of the victim's Guaikei API ...[truncated 590 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the instruction to execute echo $GUAIKEI_API_TOKEN.

  2. Replace it with a presence-only check that does not disclose the value:

    sh
    if [ -n "${GUAIKEI_API_TOKEN:-}" ]; then
      printf '%s\n' "GUAIKEI_API_TOKEN is configured"
    else
      printf '%s\n' "GUAIKEI_API_TOKEN is not configured"
    fi
    
  3. If format diagnostics are required, perform validation inside the application and report only non-sensitive properties such as whether the token is present, whether its length is acceptable, and whether it contains permitted characters.

  4. Never print the full token. If an identifier is operationally necessary, display only a heavily redacted representation, such as the final four characters, and ensure even that output is not written to persistent logs.

  5. Add explicit documentation warning users not to paste tokens into chat messages, issue trackers, screenshots, support requests, or command output.

  6. Redact authentication headers and environment-variable values in all application, agent, CI/CD, and observability logs.

  7. Revoke and rotate any token that may already have been exposed by following the existing instruction.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose describes a domain-specific Kuaishou data collection/analysis capability. However, the provided code chunk only implements reusable CLI argument parsing helpers (parseArgs, readValueAfterFlag, buildHelp). It validates flags, handles defaults and booleans, emits warnings/errors, and builds usage text. There is no network access, no Kuaishou API or scraping logic, no retrieval of videos/posts/comments, and no analysis/output logic. This is a material mismatch in primary purpose, not merely a supporting detail, because the code shown is unrelated infrastructure rather than the declared end-user functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是快手公开数据抓取与分析能力,但提供的代码并未执行任何快手数据检索、视频搜索、博主作品抓取、评论拉取或结构化分析。相反,它只是一个本地日志工具,使用 fs 和 path 在本地文件系统中创建目录并写入日志文件。这属于与声明主用途明显不一致的实际行为,并且涉及未在声明中体现的本地文件写入能力。虽然日志功能可能是辅助实现的一部分,但当前代码片段本身完全没有体现所声明的核心业务能力,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description claims substantial Kuaishou data collection and analysis capabilities, but the supplied code chunk contains only a simple utility that accesses the local filesystem to read package.json and return the package name. This is materially different from the declared purpose and does not implement any of the described platform-searching, scraping, or analytics behavior. While this may be a small supporting utility within a larger skill, based on the supplied code chunk alone it does not accurately represent the declared functionality.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly states that all task results are automatically saved to the logs/ directory, but it does not warn that those results may include user-supplied keywords, target profile/video URLs, comment data, or downstream analysis outputs. In a data-scraping and competitor-monitoring skill, these artifacts can reveal sensitive business intent, collected third-party content, or internal research activity if the local filesystem, backups, or shared environments are accessible.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all usage instructions, parameter descriptions, and examples exclusively in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This code performs authenticated HTTP requests to remote endpoints and transmits the user-provided URL and limit values, which may expose user or system data depending on the URL content. While retry errors are logged, there is no confirmation prompt, user-facing disclosure of the network transmission itself, or explanatory comment/docstring in this file warning about that behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The CLI writes fetched comment data to a local JSON file even though the skill description emphasizes structured retrieval rather than local persistence. Comment data may contain personal information or sensitive user-generated content, so silently storing it increases privacy and data-retention risk, especially on shared hosts or agent runners.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The tool stores full comment results to a local JSON file without explicit user warning or consent in this file. Silent persistence can create unanticipated privacy exposure, compliance issues, and residual sensitive data on disk long after the task completes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest frames the skill as retrieving public Kuaishou data such as videos, creator posts, and comments. This CLI additionally depends on a secret token from process.env.GUAIKEI_API_TOKEN, which introduces credential access not justified by the stated public-data purpose in the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script writes the full structured results to a local JSON file after completing the request, but this persistence is not disclosed in the described read-only/public-data behavior. Even if the source data is public, the saved output can include user queries, creator identifiers, and collected comment or post datasets, creating an undisclosed local data trail that could be accessed by other local users, tooling, or later processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Results are written to disk without any explicit warning, confirmation, or user-controlled output path in this script. Silent persistence is risky because users may believe they are performing transient retrieval, while the tool is actually creating durable artifacts containing scraped dataset contents and request metadata.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This utility sends JSON payloads over the network and includes a TOKEN header, which may transmit user or system data as well as credentials. The file contains no confirmation prompt, logging, comments, or docstring warning users that outbound requests and token-based authentication are being used.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The user-facing warning and info strings are hard-coded in Chinese, and the file provides no indication that the skill is China-region-specific or that users can opt into a language preference. This creates a natural-language policy issue because the skill imposes a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The package description and keywords are entirely in Chinese, which imposes a specific language on users reading the skill metadata. There is no indication of user language choice, multilingual support, or a documented justification that this skill is intentionally limited to a Chinese-speaking audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The natural-language instructions and support flow are entirely Chinese-centric, including the requirement to contact support via WeChat, without indicating any user language choice or opt-in. Under the stated policy, forcing a specific language or locale without user choice can be a policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The error message string is hard-coded in Chinese, which indicates a fixed language choice in user-visible output. The file does not provide any mechanism for user opt-in or locale selection, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The thrown error message is hard-coded in Chinese, creating a fixed-language user-visible response. No alternative locale handling or user choice is present in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This retry error output is hard-coded in Chinese and appears intended for user-visible logging. Because the file offers no language preference or locale selection, it violates the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The CLI's natural-language descriptions, help examples, and runtime messages are presented in Chinese only. This imposes a specific language on users without any opt-in or alternative locale selection, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest frames the skill as operating on public Kuaishou data for search and analysis. This implementation depends on a secret token from process.env.GUAIKEI_API_TOKEN, which introduces credential handling that is not mentioned in the stated scope and is not inherent from the description alone.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The CLI descriptions, examples, and output strings are presented only in Chinese, which imposes a specific language on users without offering a locale selection. This can violate language-choice policy when the skill is not clearly documented as a Chinese-only regional tool in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill's user-facing flag descriptions, help text, and status messages are presented only in Chinese, which imposes a specific language on users without opt-in. Under the policy, forcing a specific language or locale without offering a choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code persists the full search output to disk via log.taskWrite(...), which is a file-write operation that may store user-provided keywords and returned results. Although the CLI prints progress messages, there is no explicit disclosure that output will be saved locally, and this persistence is not clearly warned about in the visible help text.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file's natural-language interface text, including comments, thrown errors, and generated help output, is entirely in Chinese. For a general-purpose CLI argument parser, this imposes a specific language on users without any opt-in, selection mechanism, or documented justification for a locale-specific audience.

Content

No source excerpt is available for this finding.