Back to skill

Security audit

guaikei-kuaishou-public-comment-fetcher

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Kuaishou public-data collection tool, with the main caution that it sends requests to a third-party API and automatically saves fetched results locally.

Install only if you are comfortable using a Guaikei API token, sending Kuaishou query targets to www.guaikei.com, and retaining fetched public comments/posts/search results in local plaintext logs. Avoid using it in shared workspaces without cleaning logs, and do not print or share your GUAIKEI_API_TOKEN.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/kuaishou/comment-cli.js:142
Finding

Automatic Plaintext Persistence of Collected Comment and Profile Data

Content
View full analysis

Vulnerability Details

File Location: scripts/kuaishou/comment-cli.js:142-165; supporting file operation in scripts/utils/log.js:26-34
Vulnerability Type: Automatic plaintext storage of potentially identifying public-user data
Risk Level: Medium

Vulnerable Code

js
const finalOutput = {
  status: "success",
  error_code: "OK",
  message: "Comment retrieval completed",
  timestamp: new Date().toLocaleString(),
  request: {
    command: "comment",
    url: url,
    limit: limit,
  },
  skill_metadata: {
    skill_version: constants.VERSION,
    runtime_version: process.versions.node,
    execution_time: Date.now() - startTime,
  },
  results: commentTask,
};

url = validator.url2Name(url);
await log.taskWrite(
  `${startTime}_${url}_comment.json`,
  JSON.stringify(finalOutput, null, 2),
);

The shared logging function persists the supplied content without restrictive permissions:

js
await fs.promises.mkdir(path.dirname(outputFilename), { recursive: true });
await fs.promises.writeFile(outputFilename, content);

Technical Analysis

Every successful comment request is automatically serialized and written into the project-level logs/ directory. The saved object includes the requested video identifier and the complete API response. Depending on the response schema, this can include comment text, usernames, profile identifiers, interaction data, and other public account metadata.

Although the source data is described as public, creating an additional durable local copy increases its exposure and retention scope. Persistence is not required to return the requested JSON to the caller. The implementation provides no opt-out option, retention policy, automatic deletion, data minimization, or field-redaction mechanism.

fs.promises.writeFile is also called without an explicit file mode. Consequently, actual permissions depend on the process umask and oper ...[truncated 1435 chars]

Remediation
View remediation

Remediation Suggestions

  1. Make result persistence opt-in through an explicit option such as --save.

  2. Return results through standard output by default without creating a second durable copy.

  3. Create saved files with owner-only permissions:

    js
    await fs.promises.writeFile(outputFilename, content, {
      encoding: "utf8",
      mode: 0o600,
      flag: "wx",
    });
    
  4. Create the logs/ directory with mode 0o700.

  5. Add configurable retention and automatic deletion for old result files.

  6. Provide a redacted storage mode that removes commenter identifiers and other unnecessary fields.

  7. Warn users before storing bulk comment or profile data.

  8. Add logs/ to .gitignore and document that generated data must not be committed or shared unintentionally.

  9. Apply equivalent protections to search and creator-post results, which use the same persistence utility.

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:269
Finding

Troubleshooting Documentation Recommends Printing the Full API Token

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:269-271
Vulnerability Type: Credential exposure through terminal output
Risk Level: Low

Vulnerable Documentation

sh
echo $GUAIKEI_API_TOKEN

Technical Analysis

The troubleshooting guidance recommends using echo to verify that GUAIKEI_API_TOKEN is available. This prints the complete credential to standard output.

Environment variables are already accessible to the invoked Node.js process and do not need to be revealed to confirm their presence. Printing the token violates secret-minimization principles and can expose it through terminal scrollback, screen sharing, shell-session recording, support screenshots, CI logs, remote administration transcripts, or copied command output.

The application code itself does not log the token. The exposure arises when a user follows the documented diagnostic procedure.

Attack Path

  1. A user encounters a token configuration error.
  2. The user follows the troubleshooting instruction in SKILL.md.
  3. The shell prints the complete API token.
  4. Terminal output is retained, recorded, copied into a support request, or captured during screen sharing.
  5. A person or process with access to that output recovers the token.
  6. The exposed token may be reused against the Guaikei API until it is revoked or expires.

Impact Assessment

An exposed token may allow unauthorized use of the API with the victim's account or quota. Possible consequences include unauthorized data requests, consumption of rate limits or paid quota, service disruption, and activity attributed to the legitimate token owner.

The issue does not expose unrelated environment variables and does not directly grant local system privileges. Its scope is limited to the permissions assigned to GUAIKEI_API_TOKEN.

Remediation
View remediation

Remediation Suggestions

Replace the full-token output command with a presence-only check:

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

Additional hardening measures:

  1. Never recommend printing the complete token.
  2. If identification is necessary, display only a short masked suffix.
  3. Warn users not to include tokens in screenshots, logs, issue reports, or support messages.
  4. Document token revocation and rotation procedures.
  5. Recommend using secret stores or protected CI variables rather than plaintext shell configuration.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (34)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

该代码块的核心功能是‘根据快手博主主页URL或USER_ID获取作品列表’,支持排序和数量控制,并将结果以 JSON 输出及写入本地日志。它并未显示进行作品详情解析、互动指标分析、内容调研或内容分析等更高层能力,因此与声明的分析型、多维度数据能力不完全一致。尤其“作品详情/work details”通常意味着针对单个作品的详细信息,而此处参数和流程都围绕博主主页/用户及其作品集合展开,属于相近但不同的功能。日志写入属于次要实现细节,但也是未声明的附带能力。综上应判定为存在描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description claims Kuaishou/Kwai work-detail and analytics functionality, but the code chunk only implements a reusable CLI args parser (parseArgs, readValueAfterFlag, buildHelp). It does not access Kuaishou resources, process content metrics, analyze works, or perform any platform-specific operations. This is a materially different primary purpose, so the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述聚焦于快手/Kwai 内容与数据分析能力,但提供的代码片段并未体现任何与快手作品详情、数据分析、互动指标或内容调研相关的逻辑。相反,该代码只是在本地文件系统中写入日志文件。虽然日志功能可能属于辅助实现细节,但当前代码片段的实际行为与声明用途没有直接对应关系,且涉及未声明的本地文件写入能力。因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description says the skill performs Kuaishou/Kwai work-detail and analytics functions. However, this code chunk does not implement any such behavior; it only reads package.json from the local filesystem and returns the package name. While utility code can be a supporting detail, this specific behavior is unrelated to the stated purpose and shows no evidence of the declared analytics capabilities in this chunk.

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.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description at L003 describes the skill as covering Kuaishou work details, work data, interaction metrics, research, and analysis, but does not mention search, creator monitoring, or comment fetching. The body of the skill documentation explicitly states three capabilities beyond 'work details': keyword search, blogger work monitoring, and video comment retrieval (L80-L85, L103-L105), creating a semantic mismatch between the advertised scope and the actual behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description and the entire user-facing guidance are written in Chinese, and the file does not offer any language or locale choice for users. Under the stated 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
88% confidence
Finding

The README states that all task results are automatically saved to the logs/ directory, but it does not clearly warn users that scraped comment and content data will be persisted locally. Because this skill is specifically designed to collect large volumes of public comments and content metadata, silent local retention increases the risk of unintended storage, disclosure, and mishandling of potentially sensitive or regulated data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The changelog heading and all entries are written in Chinese, and the file does not indicate that the skill is region-specific or that users can opt into this language. Per the policy, forcing a specific language without user choice or clear justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file presents all user-facing instructions and parameter descriptions exclusively in Chinese. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is clearly justified, which is not stated here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is presented as a read-oriented analytics/detail-fetching tool, but this CLI fetches public comments and then persists the returned dataset locally. That expands the data-handling surface from transient retrieval to collection and retention, which can create privacy, compliance, and operator-surprise risks when comment data is stored without clear disclosure or minimization.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The local file-writing behavior is not clearly required by the stated purpose of fetching details/analytics, so it introduces unnecessary persistence of scraped comment data on disk. Unnecessary storage increases the risk of secondary exposure through shared systems, backups, logs, or later misuse of collected data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The CLI writes comment results to a local JSON file without any explicit warning or consent flow in this file, which can surprise users and silently retain potentially sensitive or regulated content. Even public comments can become more sensitive when aggregated, timestamped, and stored locally as a reusable dataset.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest names the skill as a 'public comment fetcher', but this file accepts a creator profile URL or user ID and then creates and retrieves a 'post' task via post.createPostTask/getPostTask. The implemented behavior is fetching works/posts from a profile, which does not match a comment-fetching capability implied by the declared skill identity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The script reads a sensitive API token from the environment and sends user-supplied URL data through post.createPostTask and post.getPostTask, but this file does not explicitly disclose that remote API requests will be made using those inputs. While network access may be part of the tool's purpose, there is no direct warning in the code/help text that user input and credentials are transmitted to an external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script writes retrieved results to disk without an explicit user-facing warning, confirmation, or opt-in control. Silent persistence increases privacy and compliance risk because users may expect transient CLI output, while the saved JSON may contain identifiers, metadata, or collected platform content that remains on disk after execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes the skill as being for Kuaishou data analysis, work details, work data, interaction metrics, and content analysis, but this file implements a keyword search workflow that creates and retrieves search tasks for discovering content. Search/discovery is a materially different capability from fetching details or comments for specified works.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script persists full search output to a local JSON file named with the user keyword and parameters, but this file does not clearly warn users that their query and returned data will be stored on disk. This can leak sensitive research terms, operational metadata, or fetched content to other local users, backups, or log collectors, especially in shared or automated environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs outbound HTTPS GET and POST requests and includes a TOKEN header plus request data, which can transmit user or system data to a remote service. In this file there is no confirmation prompt, user-facing log/print, or explanatory comment/docstring disclosing that network transmission and token use occur.

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 all user-facing error text in Chinese, which can force a specific language on users regardless of their locale. The file does not show any opt-in, localization mechanism, or documented region-specific justification, matching the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The package description is written entirely in Chinese, which implicitly fixes the skill's user-facing language without indicating that users can choose another language. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless the locale constraint is documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code performs HTTP requests that send user-supplied data (url, limit) and an authentication token, but the file provides no confirmation prompt, explanatory comment, or other user-facing disclosure of that transmission. For code files, undisclosed network transmission of user or system data is in scope when there is no visible warning in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings in the CLI, including flag descriptions, examples, and runtime messages, are presented only in Chinese. This forces a specific language/locale on users without offering an explicit language choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's descriptions, help examples, errors, and status messages are all presented in Chinese, with no option for users to select another language. This can violate a language/locale policy when a skill mandates a specific language without explicit opt-in or documented regional justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The code loads an API token from process.env.GUAIKEI_API_TOKEN to operate the service. While this may be operationally necessary, the manifest only describes Kuaishou analytics/detail retrieval and does not mention credential handling, making this capability undeclared relative to the stated purpose.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:15