Back to skill

Security audit

guaikei-douyin-snapshot-collector

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Douyin research purpose, but needs review because it broadly triggers on vague requests, sends tokens and user queries to a third-party API, saves collected data locally, and exposes video download URL fields despite saying downloading is out of scope.

Install only if you are comfortable with guaikei.com receiving your API token, search terms, and Douyin URLs, and with successful collection results being saved under the skill's logs directory. Avoid sensitive research terms on shared machines, restrict use to explicit Douyin requests, and treat returned media URL fields carefully because the artifact's no-download claim is inconsistent with its schemas.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
src/utils/request.js:98
Finding

Authentication Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:59-62, 104-107; src/api/comment.js:38-40, 67-70; src/api/post.js:23-25, 50-53; src/api/hot.js:19-22; src/utils/request.js:98-117
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: Medium

Vulnerable Code

src/api/search.js:59-62:

js
const params = {
  _: Date.now(),
  token: token,
};

src/api/search.js:104-107:

js
const params = {
  _: Date.now(),
  token: token,
  keyword: keyword,

src/api/comment.js:38-40:

js
const params = {
  _: Date.now(),
  token: token,
};

src/api/comment.js:67-71:

js
const params = {
  _: Date.now(),
  token: token,
  url: url,
  limit: limit,
};

src/api/post.js:23-25:

js
const params = {
  _: Date.now(),
  token: token,
};

src/api/post.js:50-54:

js
const params = {
  _: Date.now(),
  token: token,
  url: url,
  limit: limit,
};

src/api/hot.js:19-22:

js
const res = await getJson("/api/douyin/hot-search", {
  _: Date.now(),
  token: token,
});

src/utils/request.js:98-117:

js
params.skill_name = skillName();

const fullPath = `${path}?${querystring.stringify(params)}`;
const jsonData = JSON.stringify(data);

const options = {
  host: constants.BASE_URL,
  path: fullPath,
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Accept-Encoding": "identity",
    "Content-Length": Buffer.byteLength(jsonData),
  },
};

return await request(options, jsonData);

Technical Analysis

Every API method places GUAIKEI_API_TOKEN in a parameter object that is serialized directly into the URL query string. Although the requests use HTTPS, TLS only protects the request in transit. It does not prevent the full request target from being recorded by the destination server, reverse pr ...[truncated 1886 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove token from every URL parameter object.

  2. Transmit credentials using an authorization header, for example:

    js
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
      "Accept-Encoding": "identity",
    }
    
  3. Refactor getJson and postJson so authentication is supplied separately from ordinary query parameters.

  4. Never include tokens in exception messages, telemetry, filenames, or debug output.

  5. Configure the API server, proxies, and monitoring systems to redact sensitive query parameters from historical and future logs.

  6. Rotate tokens that have already been used by the affected implementation because they may exist in retained logs.

  7. Add automated tests asserting that generated request paths never contain token, access_token, or other credential parameters.

  8. Apply short token lifetimes, revocation support, rate limits, and narrowly scoped permissions to reduce the consequences of future exposure.

T01 · Skill Instruction Hijacking

Note
Location
src/utils/token.js:23
Finding

Promotional Contact Information Injected into Authentication Error Output

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:23-31; src/utils/request.js:50-56; conflicting policy in SKILL.md:37-40
Vulnerability Type: Agent-facing output manipulation and policy inconsistency
Risk Level: Low

Vulnerable Code

src/utils/token.js:23-31:

js
function skillToken(token) {
  if (!isValidToken(token)) {
    utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. ");
    utils.printSuccess("\t快速获取通道: www.guaikei.com");
    return "";
  }

  utils.printInfo("已使用配置的私有TOKEN");
  return token;
}

src/utils/request.js:50-56:

js
} else if (res.statusCode === 401 || res.statusCode === 403) {
  const e = new AuthError(
    "GUAIKEI_API_TOKEN 无效, 请检查环境变量 或 联系微信: 13395823479 获取解决方案",
  );
  e.noRetry = true;
  reject(e);

The runtime behavior conflicts with the declared policy in SKILL.md:37-40, which requires neutral authentication errors and prohibits runtime contact details, website links, or promotional content.

Technical Analysis

When a locally supplied token fails format validation, the Skill emits a website address. When the remote service returns HTTP 401 or 403, it constructs an error containing a phone number or WeChat contact. The CLI subsequently prints propagated error messages, so this content can enter Agent-consumed output and may be repeated to the user.

This behavior is not merely undocumented support text: it directly contradicts the Skill's explicit token-management rules. Those rules state that invalid-token errors must be neutral, contact information must remain exclusively in user documentation, and runtime output must not contain promotional guidance.

The behavior is restricted to authentication-failure paths. It does not modify persistent Agent memory, execute code, override general safety controls, or require the Agent to include the promotion in every response. It is therefore assessed as low-risk instruction/o ...[truncated 1427 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace both authentication-failure messages with the neutral error required by SKILL.md, such as: GUAIKEI_API_TOKEN is missing or invalid; execution has stopped.
  2. Remove website addresses, telephone numbers, WeChat identifiers, and other marketing or support channels from all runtime output.
  3. Keep optional support information only in clearly identified user documentation.
  4. Return a stable machine-readable error object with an error code such as AUTH_REQUIRED, without promotional text.
  5. Ensure authentication errors continue to terminate immediately with exit code 3 and are never retried.
  6. Add tests that invoke commands with missing, malformed, expired, and unauthorized tokens and assert that stdout and stderr contain no URLs, phone numbers, social-media identifiers, or promotional phrases.
  7. Add a consistency test comparing documented error-handling requirements with actual runtime messages.
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill states it writes output files to logs/ and performs local path/file handling, but this local filesystem behavior is not clearly reflected in the high-level purpose and permission model. Undeclared file writes can create privacy, retention, and auditability risks, especially when collected content or query terms may be sensitive and persist on disk unexpectedly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill states it writes output files to logs/ and performs local path/file handling, but this local filesystem behavior is not clearly reflected in the high-level purpose and permission model. Undeclared file writes can create privacy, retention, and auditability risks, especially when collected content or query terms may be sensitive and persist on disk unexpectedly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill states it writes output files to logs/ and performs local path/file handling, but this local filesystem behavior is not clearly reflected in the high-level purpose and permission model. Undeclared file writes can create privacy, retention, and auditability risks, especially when collected content or query terms may be sensitive and persist on disk unexpectedly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill states it writes output files to logs/ and performs local path/file handling, but this local filesystem behavior is not clearly reflected in the high-level purpose and permission model. Undeclared file writes can create privacy, retention, and auditability risks, especially when collected content or query terms may be sensitive and persist on disk unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description says it should activate even when the user only says generic phrases like '查一下' or '帮我看看' without explicitly naming Douyin. Overly broad trigger language can cause the skill to capture unrelated user requests and send unintended searches or data collection queries to an external service, violating user intent and increasing the chance of unnecessary data disclosure.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generalized trigger guidance extends activation to broad research and multi-step workflows even when Douyin is not explicitly specified. This is dangerous because it allows the skill to opportunistically insert itself into unrelated tasks, potentially causing external API calls, collection of third-party content, or logging of user research topics without clear consent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly relies on the environment variable GUAIKEI_API_TOKEN, but the manifest does not declare any tool scope such as permissions or allowed-tools for environment access. This creates a transparency and least-privilege problem: the runtime may expose secrets or capabilities not clearly documented to the platform or reviewer, increasing the chance of accidental overreach or misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The statement "纯中文界面" imposes a language constraint in natural language, but the file does not offer user opt-in, fallback, or justification that the skill must operate only in Chinese for compliance reasons. This can violate language/locale policy expectations for user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The title and field descriptions consistently force a single language/locale in natural-language strings. Under the stated policy, language-specific wording without user opt-in or documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The schema explicitly documents video_url as both playback and download addresses, which conflicts with the skill description stating it does not handle video downloading. This mismatch can enable downstream agents or integrators to expose or use download links anyway, expanding the skill’s effective capability beyond what users and reviewers were told.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This JSON schema is a manifest-type file, so natural-language policy checks apply. The title and descriptions consistently force a specific language/locale, and there is no indication that the skill is China-specific or that users can opt into Chinese, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The schema explicitly exposes play_addr and describes it as both a playback address and a video download address, which conflicts with the skill's stated scope that it does not handle downloading. This mismatch can enable downstream agents or users to retrieve downloadable media anyway, bypassing product/policy constraints and expanding the skill's effective capability beyond what was declared.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README states that the skill automatically exports JSON logs to a local logs directory, but it does not prominently warn that queried Douyin data, URLs, and potentially sensitive research targets or comment content will be persisted on disk. In an agent setting, silent persistence can create privacy, retention, and data handling risks, especially on shared machines or managed environments where users may not expect local writes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code sends a token and video URL to external API endpoints via requestApi, which is a data-transmitting network operation. Although the functions have developer-facing docstrings, there is no user-facing disclosure, confirmation, or warning in this file about sending potentially sensitive identifiers off-system.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The getCommentTask function performs an HTTP request that includes the token and video URL as request parameters. This is a safety-relevant network action involving user/system data, but the file contains only developer-oriented comments and no user-facing warning or notice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language content in the file is entirely Chinese, including the module description and parameter/return documentation. Per the policy, forcing a specific language without user opt-in or a documented locale-specific justification is a policy concern.

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 fetched Douyin comment data to a local JSON file automatically after successful execution, but this file does not provide a clear user-facing disclosure or consent step before persisting potentially sensitive or regulated third-party content. In a data-collection skill, silent local retention increases privacy, compliance, and data-handling risk because comments may contain personal data and may remain on disk longer than the user expects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code reads a credential from process.env.GUAIKEI_API_TOKEN, which is a sensitive environment variable access covered by the warning rule for code files. Although the token is used for API calls, this file does not show a user-facing warning, confirmation, or explanatory comment about reading that credential.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI silently writes the full result set to a local JSON file after execution, without any visible user consent or warning in this file. Because the skill is designed to collect creator/video data at scale, this can unexpectedly persist scraped content and metadata on disk, increasing privacy, retention, and data exposure risk on shared or compromised systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI writes the full search output, including user-supplied keywords and returned content, to a local file by default without explicit notice or consent. In this skill's context, users may search sensitive topics, people, or trends, so silent persistence creates a privacy and data-handling risk if the host machine is shared, monitored, or later compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code performs outbound HTTPS requests and may send URL parameters and JSON request bodies to a remote host, but there is no confirmation prompt or user-facing disclosure at the point of transmission. While the file contains internal comments and retry error logging, those do not warn the user that their data may be sent over the network.

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 strings at L25-L30 are entirely in Chinese, which imposes a specific language on users without any visible opt-in or fallback. This matches the policy category for language or locale constraints that are not optional or justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JavaScript file contains user-facing validation and formatting strings entirely in Chinese, such as error messages and result labels. Because the file does not provide any user opt-in or locale selection mechanism, it appears to enforce a specific language, which matches 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
95% confidence
Finding

This JSON schema contains user-facing title and description fields exclusively in Chinese, including the parameter descriptions. Because the file does not indicate that the skill is region-specific or that users may choose another language, it may violate language/locale policy requiring opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON schema contains natural-language title and description fields exclusively in Chinese, which imposes a specific language on consumers of the skill metadata. Under the language/locale policy rule, this is a violation because the file does not offer a language choice or explain a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.