Back to skill

Security audit

guaikei-kuaishou-trend-insights

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Kuaishou analytics purpose, but it has review-worthy credential and data-retention risks.

Review before installing. Use a narrowly scoped Guaikei token, do not print or paste the token into terminals or chats, and expect successful queries to leave full result files in the local `logs/` directory unless you remove them manually.

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 Guidance

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:271
Vulnerability Type: Exposure of a sensitive environment variable through terminal output
Risk Level: Medium

Vulnerable Code Snippet

markdown
> 自查:多半是 `GUAIKEI_API_TOKEN` 未通过校验(见 Q1)。运行前先 `echo $GUAIKEI_API_TOKEN` 确认变量已注入。

The instruction tells users or an AI agent to run:

bash
echo $GUAIKEI_API_TOKEN

Technical Analysis

GUAIKEI_API_TOKEN is the private credential used to authenticate requests to the external API service. Printing the variable exposes its complete value to standard output.

In agent, CI/CD, support, or managed-terminal environments, standard output may be retained in execution transcripts, build logs, shell recordings, observability systems, or support artifacts. Verifying whether an environment variable is configured only requires testing whether it is non-empty; revealing its complete value is unnecessary and violates least-disclosure principles.

The application code otherwise sends the token only as an HTTPS request header to the fixed, documented API host. The vulnerability is therefore in the troubleshooting instruction rather than the normal request flow.

Attack Path

  1. A user experiences a startup or authentication failure.
  2. The user or AI agent follows the troubleshooting guidance in SKILL.md.
  3. The shell expands $GUAIKEI_API_TOKEN and prints the complete credential.
  4. The terminal output is retained in an agent transcript, CI log, shell recording, or support artifact.
  5. A party with access to that retained output extracts the token.
  6. The exposed token can be replayed against the Guaikei API until it is revoked or expires.

No command injection or privilege escalation is required; exploitation depends on access to the captured output.

Impact Assessment

An attacker could obtain the same API authorization associated with the exposed token. This may permit unauthorized use of the victim's API account, consumption of quotas ...[truncated 309 chars]

Remediation
View remediation

Remediation Suggestions

Replace the token-printing instruction with a non-disclosing presence check:

bash
if [ -n "${GUAIKEI_API_TOKEN:-}" ]; then
  echo "GUAIKEI_API_TOKEN is configured"
else
  echo "GUAIKEI_API_TOKEN is missing"
fi

For a concise POSIX-compatible alternative:

bash
test -n "${GUAIKEI_API_TOKEN:-}" && echo "configured" || echo "missing"

Additional hardening measures:

  1. Explicitly instruct users never to print, paste, or share the complete token.
  2. If format inspection is necessary, validate length and allowed characters without displaying the value.
  3. If partial identification is unavoidable, expose only a short masked prefix or suffix.
  4. Redact GUAIKEI_API_TOKEN from agent transcripts, CI logs, telemetry, and support bundles.
  5. Revoke and rotate any token that may already have appeared in captured output.
  6. Keep the existing practice of transmitting the token only over HTTPS to the fixed documented API endpoint.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A declared-purpose/actual-behavior mismatch is a supply-chain trust problem: the skill presents itself as a Kuaishou analytics tool but reportedly omits those capabilities while accessing the local filesystem. In context, the request for an API token and the extensive operational guidance make the mismatch more concerning, because users may provide credentials and data to a component whose real behavior is not transparent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A declared-purpose/actual-behavior mismatch is a supply-chain trust problem: the skill presents itself as a Kuaishou analytics tool but reportedly omits those capabilities while accessing the local filesystem. In context, the request for an API token and the extensive operational guidance make the mismatch more concerning, because users may provide credentials and data to a component whose real behavior is not transparent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A declared-purpose/actual-behavior mismatch is a supply-chain trust problem: the skill presents itself as a Kuaishou analytics tool but reportedly omits those capabilities while accessing the local filesystem. In context, the request for an API token and the extensive operational guidance make the mismatch more concerning, because users may provide credentials and data to a component whose real behavior is not transparent.

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
91% confidence
Finding

The README states that all task results are automatically saved to the logs/ directory, but it does not warn users that searched keywords, creator/profile URLs, video URLs, and fetched comment content may persist on disk. In a data collection and competitor-monitoring tool, this can expose sensitive business research, monitoring targets, or scraped public-content datasets to other local users, backups, or downstream systems if log retention is not controlled.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The CLI persists fetched comment data to a local JSON file after already printing the full results to stdout, creating undisclosed local retention of third-party content. This increases data exposure on shared systems, leaves residual files that may be harvested later, and exceeds a strict expectation of transient retrieval/analysis output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script silently writes retrieved comments to a local file without explicit notice or consent in this execution path. Because comment data may contain personal or sensitive user-generated content, silent persistence can create privacy, compliance, and local data leakage risks, especially on multi-user or managed environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The code retrieves a token from process.env.GUAIKEI_API_TOKEN and then calls post.createPostTask and post.getPostTask, which are clearly network/API operations based on naming and module structure. Although status messages are printed, this file does not explicitly warn the user that their supplied URL and credentials will be used in outbound API requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script persists the full fetched results to a local JSON file after completing what is presented as a query-style operation. Even if the data is from a public platform, writing it to disk creates an undeclared retention channel that can expose creator/comment data to other local users, backups, or later unintended reuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script silently writes fetched results to a local JSON file without clear user consent in this interface. That can surprise users who expect transient output only and increases privacy and data-handling risk because retrieved datasets remain on disk after execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest frames the skill as retrieving Kuaishou public data such as video search, creator posts, and comments. This file requires and consumes GUAIKEI_API_TOKEN, introducing credential-dependent authenticated access that is not justified by the stated public-data purpose in the manifest text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file handles a sensitive API credential via the TOKEN header and explicitly references the GUAIKEI_API_TOKEN environment variable in an error message, but provides no warning or documentation about accessing and using that credential. For code files, access to sensitive environment variables or credentials should not be silent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code performs outbound HTTPS GET and POST requests and includes a TOKEN header, query parameters, and JSON payloads, but there is no confirmation prompt, logging, comment, or docstring disclosing that user or system data may be sent to a remote service. For code files, network calls that transmit data should have some visible user disclosure unless clearly covered elsewhere.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code emits multiple user-facing error strings only in Chinese, such as the messages on lines 5, 10, 14, 18, 23, 50, 54, 59, and 64. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the locale restriction is clearly documented and justified, which is not evident in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description and the body of the skill are predominantly in Chinese and direct agent behavior in Chinese, but nowhere state that the skill is region-specific or that users may choose another language. Under the policy, forcing a specific language without opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language description is entirely in Chinese, which can constitute a language-policy issue when the skill presents itself without offering any language choice or documenting a locale-specific scope. Nothing in the manifest indicates this skill is limited to Chinese-speaking users or a China-specific compliance context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Natural-language policy violations include forcing a specific language without user opt-in. This README presents all instructions and operational guidance only in Chinese, with no indication of language selection or justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

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

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest frames the skill as retrieving public Kuaishou data such as videos, posts, and comments. This CLI reads GUAIKEI_API_TOKEN from the environment to perform its operation, which introduces credential handling capability not mentioned in the stated purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file presents descriptions, examples, errors, and status output in Chinese, which imposes a specific language on all users. There is no visible mechanism to select another locale or to opt into the language choice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest frames the skill as operating on Kuaishou public data for search and analysis, but this file reads process.env.GUAIKEI_API_TOKEN to obtain credentials. While backend API access may be an implementation detail, credential access is not expressed in the stated purpose and is therefore an additional capability beyond the plain-language description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The CLI writes full search output to a local JSON file automatically, creating persistent storage of user queries and retrieved content beyond the stated retrieval behavior. This can expose potentially sensitive research terms, monitoring targets, or collected content to other local users, backup systems, or later unintended reuse, especially because the filename also embeds the keyword.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This script saves search results locally without any user-facing confirmation or warning, so operators may believe the tool only prints results to stdout when it also creates an artifact on disk. Silent persistence increases privacy and operational risk because collected data and search intent remain stored after execution without explicit consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JavaScript file uses Chinese exclusively for comments, error messages, and help text, including user-facing strings such as parameter errors and usage output. Under the policy, forcing a specific language without offering a language/locale choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Multiple user-visible error messages are hardcoded in Chinese, including validation failures and authentication guidance, with no option for another language or user choice. This is a natural-language policy concern because the skill imposes a specific language/locale without documented opt-in or justification.

Content

No source excerpt is available for this finding.