Back to skill

Security audit

guaikei-douyin-public-content-to-dataset-export

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Douyin public-data collection tool, but it needs Review because it broadly triggers external collection, automatically stores scraped data, exposes tokens in URL query strings, and contradicts its own runtime-output limits.

Review this skill before installing in shared or enterprise environments. Use a limited, revocable GUAIKEI_API_TOKEN, assume queries/results may be saved under logs, avoid collecting more comments/account data than needed, and verify that use complies with platform terms and applicable privacy rules.

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
src/utils/request.js:99
Finding

API Token Transmitted in URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:99-102, src/utils/request.js:128-132, src/api/search.js:58-63, src/api/search.js:103-112, src/api/post.js:23-27, src/api/post.js:50-55, src/api/comment.js:38-43, src/api/comment.js:67-72, src/api/hot.js:17-21
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

The API modules place the token in a parameter object:

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

The shared request implementation then serializes every parameter, including the token, into the URL:

js
params.skill_name = skillName();

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

The same behavior occurs for GET requests:

js
params._ = Date.now();

const fullPath = `${path}?${querystring.stringify(params)}`;
const options = {
  host: constants.BASE_URL,
  path: fullPath,
  method: "GET",
  headers: { "Accept-Encoding": "identity" },
};

For example, the search result request includes the credential alongside user-controlled search parameters:

js
const params = {
  _: Date.now(),
  token: token,
  keyword: keyword,
  sort_type: sort,
  publish_time: time,
  filter_duration: duration,
  content_type: content,
  limit: limit,
};

const response = await requestApi(
  "GET",
  "/api/douyin/general-search/info",
  params,
  null,
  constants.QUERY_MAX_ATTEMPTS,
  "查询任务",
);

Technical Analysis

GUAIKEI_API_TOKEN is used as a reusable authentication credential, but every API call transmits it as part of the request-target query string. Although HTTPS encrypts the request while it is in transit, it does not prevent the complete URL from being recorded after TLS termination.

Query strings are commonly retained in web-server access logs, reverse-proxy logs, ap ...[truncated 1760 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove token from every query-parameter object.

  2. Transmit the credential in an HTTP authorization header, for example:

    js
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
      "Accept-Encoding": "identity",
    }
    
  3. Refactor getJson() and postJson() to receive authentication separately from ordinary request parameters.

  4. Ensure logging and telemetry systems redact Authorization, cookies, API keys, and any legacy token query parameter.

  5. Reject future requests that submit credentials through the query string after a reasonable migration period.

  6. Rotate tokens that have already been used by affected versions, because they may exist in historical logs.

  7. Add automated tests confirming that generated request paths never contain token=, while the authorization header is present.

  8. Apply short expiration periods, least-privilege scopes, rate limits, and revocation support to API tokens.

other

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

Authentication Failures Emit Undisclosed Promotional and Contact Information

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:23-31, src/utils/request.js:51-55
Vulnerability Type: Undisclosed promotional output and security-documentation mismatch
Risk Level: Low

Vulnerable Code

A missing or malformed local token causes the runtime to print the vendor website:

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

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

A token rejected by the remote API causes the runtime error to include a WeChat phone number:

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

These behaviors contradict the declared token-management requirements in SKILL.md, which state that authentication failures will use a neutral error and that runtime output will not contain contact information, website links, or promotional wording.

Technical Analysis

The Skill advertises a constrained authentication-failure behavior as an audit-relevant security property. The implementation does not enforce that property.

Two separate authentication paths expose promotional content:

  • Local format validation prints www.guaikei.com.
  • An HTTP 401 or 403 creates an AuthError containing a WeChat contact number.

CLI error handlers subsequently emit error.message, so the remote-authentication message reaches runtime output. In an agent environment, stderr and structured error output can be incorporated into the agent's response, execution transcript, telemetry, or persistent logs.

This is not a local privilege-escalation or code-execution vulnerability. It is an integrity and disclosure issue in which documented neutral ...[truncated 1528 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace both authentication-failure messages with the neutral message documented by the Skill, without any URL, phone number, or marketing wording.
  2. Keep token-acquisition instructions and contact details exclusively in opt-in documentation.
  3. Centralize authentication error construction so local validation failures and remote 401/403 responses produce the same sanitized message and exit code.
  4. Ensure authentication errors are emitted only to the intended error channel and never mixed with successful JSON output.
  5. Add regression tests that run all four CLIs under these conditions:
    • Missing token.
    • Malformed token.
    • Valid-format but rejected token.
    • Expired or unauthorized token.
  6. Assert that output contains no URL, domain name, phone number, social-media contact, or promotional phrase.
  7. Review other runtime messages such as “contact the developer” and either remove them or document them accurately.
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 (45)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill states that logs are automatically written to a local logs/ directory, but this file-persistence behavior is not surfaced in the top-level purpose statement or paired with a clear user warning. Persisting searched keywords, URLs, and returned public-data content can create privacy, retention, or multi-tenant leakage risks on shared systems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill states that logs are automatically written to a local logs/ directory, but this file-persistence behavior is not surfaced in the top-level purpose statement or paired with a clear user warning. Persisting searched keywords, URLs, and returned public-data content can create privacy, retention, or multi-tenant leakage risks on shared systems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill states that logs are automatically written to a local logs/ directory, but this file-persistence behavior is not surfaced in the top-level purpose statement or paired with a clear user warning. Persisting searched keywords, URLs, and returned public-data content can create privacy, retention, or multi-tenant leakage risks on shared systems.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly says it should trigger even when the user does not mention Douyin, greatly broadening activation scope. Over-broad routing can cause the agent to invoke external-data collection, token use, and local logging in contexts where the user did not intend platform-specific scraping or persistence.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The generalized trigger guidance is ambiguous and insufficiently bounded, which can lead the agent to over-apply the skill based on loose signals like content research or competitor analysis. In practice this increases the chance of unintended external queries, unnecessary token consumption, and data persistence without clear user intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill documents use of an environment variable token but does not declare an explicit tool/permission scope for environment access. In an agent setting, undeclared capability requirements can bypass user and platform expectations about what the skill may read, making secret exposure or over-broad execution easier.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation says logs are automatically saved locally but does not prominently warn users that requests and results may persist on disk. This can expose searched topics, creator URLs, and collected content to later users, backups, or administrators, especially in shared or enterprise environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language statement '纯中文界面' indicates the skill is limited to Chinese, but the file does not present this as a user choice or justified region-specific constraint. This can violate language/locale policy when users are not given an opt-in or alternative.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest explicitly states the skill is not used for publishing/editing/downloading videos, but this response schema defines video_url as containing both playback and download addresses. That indicates the skill exposes download-capable output beyond the stated scope of public-data search and analytics.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and descriptions are written only in Chinese, which imposes a specific language on users of this schema. Under the policy, locale or language constraints should either be optional for the user or clearly documented as intentionally region-specific; this file does neither.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The schema explicitly documents play_addr as both a playback URL and a video download address, which conflicts with the skill metadata stating it is not for downloading videos. Even though this file is only a schema, documenting and normalizing a download field can enable downstream components or users to misuse the skill for prohibited content acquisition, weakening policy boundaries around allowed use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill encourages scraping comment details and competitor account content at scale for analysis, but does not clearly warn about privacy, consent, platform-terms, or profiling risks associated with collecting third-party data. In this context, the operational purpose is bulk surveillance/analysis of other users' content, which makes omission of compliance safeguards more dangerous than a generic public-web search tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README explicitly promotes automatic export of scraped Douyin public data to JSON logs for later analysis, but it does not provide a clear privacy, retention, or compliance warning for handling potentially personal data contained in videos, account metadata, and comments. Even when data is publicly accessible, bulk collection and local persistence materially increase privacy and legal/compliance risk, especially if logs are retained, shared, or repurposed without controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all usage instructions, parameter descriptions, and examples exclusively in Chinese. The policy requires flagging language or locale constraints when a skill forces a specific language without user opt-in or a clearly documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The strings "创建任务" and "查询任务" are natural-language labels embedded in the code and indicate the skill presents or logs operation names only in Chinese. This creates a language/locale policy concern because the skill does not offer user opt-in or any alternative locale, and no region-specific justification is documented in this file.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The CLI writes the full fetched comment dataset to a local JSON file after completing the request, but this storage behavior is not surfaced to the user in the command flow. Comments can contain personal data or sensitive user-generated content, so silently persisting them increases privacy, retention, and accidental disclosure risk on the host system.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code saves comment results to disk without any warning, confirmation, or clear indication that data will be retained locally. In a skill framed as query/read-only access to public Douyin content, silent export creates a mismatch in user expectations and may expose collected data to other local users, backup systems, or later misuse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The CLI persists fetched Douyin results to a local JSON file after printing them, creating an additional at-rest copy of collected data without any clear user opt-in or retention controls. Even if the source data is public, local persistence expands exposure through accidental disclosure, over-collection, and unexpected reuse on shared systems or agent hosts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Search results are silently persisted to disk without a clear user-facing warning or consent. This can leak collected content and user interests to other local users, backups, telemetry, or later processes, especially when comments or other potentially sensitive text are included in the results.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Multiple error messages are hard-coded in Chinese, including API failure and authentication guidance text, with no indication that the user can choose another language or locale. This is a natural-language policy concern because the skill appears to force a specific language in user-visible messaging without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code emits all user-facing status and warning messages in Chinese, including the warning about token misconfiguration and the info message about using a private token. The file does not indicate that the skill is China-specific or provide any language selection or opt-in, which creates a natural-language locale policy violation under the stated rules.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The human-readable title and field descriptions are entirely in Chinese, which imposes a specific language on users without any visible opt-in, fallback, or explanation that the skill is region-specific. This is a natural-language policy concern because the file communicates the interface in a single language with no documented choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This JSON schema uses Chinese-language title and descriptions throughout, which can impose a fixed language/locale on downstream users or tooling without any opt-in or justification. The file does not indicate that the schema is intentionally region-specific or that alternative locales are supported.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This JSON schema uses Chinese-only natural-language metadata in the title and description fields, which can imply a fixed language/locale for downstream users or tooling. Because there is no indication that the schema is intentionally region-specific or that language choice is optional, this may conflict with the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language fields in this schema are entirely in Chinese, including the title and parameter descriptions, with no indication that the skill is China-specific or that other languages are supported. This can violate a language/locale policy when users are not given an explicit language choice or opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.