Back to skill

Security audit

guaikei-douyin-lookup-tool

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Douyin public-data lookup tool, but it needs review because auth failures include undisclosed promotional contacts and API tokens are sent in request URLs.

Review before installing. Use this only if you are comfortable sending Douyin URLs, keywords, limits, and your GUAIKEI_API_TOKEN to guaikei.com, and with search/post/comment outputs being saved locally under logs/. Avoid sensitive research terms, protect and rotate the token, and be aware that runtime auth failures may display external promotional contact information.

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)

T01 · Skill Instruction Hijacking

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

Authentication Error Paths Inject Promotional Website and Contact Information

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:23-28; src/utils/request.js:50-56
Vulnerability Type: Runtime promotional output that contradicts the Skill's declared authentication-handling rules
Risk Level: High

Vulnerable Code

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

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

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);

Technical Analysis

The Skill documentation at SKILL.md:38-39 explicitly requires authentication failures to produce only neutral error messages. It also states that runtime output must not contain contact details, website links, or promotional content.

The implementation violates those declared constraints in two separate authentication error paths:

  1. Local token-format validation prints a fixed token-acquisition website.
  2. HTTP 401 or 403 responses create an authentication error containing a fixed WeChat contact and telephone number.

These messages are not derived from user input and are deliberately embedded in predictable runtime paths. The HTTP authentication message is propagated by the CLI error handlers into both stderr diagnostics and structured stdout error responses. The behavior can therefore influence agent-visible or user-visible output even though the Skill description expressly prohibits it.

Attack Path

Local validation path:

  1. A user invokes any CLI without GUAIKEI_API_TOKEN, or supplies a token that fails the length or character-set validation.
  2. The CLI calls skillToken().
  3. skillToken() prints the hardcoded www.guaikei.com acqui ...[truncated 1447 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove all websites, telephone numbers, social-media contacts, acquisition instructions, and promotional wording from runtime error paths.
  2. Replace local validation output with a neutral message such as: GUAIKEI_API_TOKEN is missing or has an invalid format; execution has stopped.
  3. Replace HTTP 401 and 403 handling with a neutral AuthError that does not direct users to any external channel.
  4. Ensure authentication failures consistently return exit code 3 without retrying.
  5. Keep any legitimate account-registration information exclusively in user documentation, clearly separated from runtime behavior.
  6. Add automated tests that invoke all CLIs with missing, malformed, and rejected tokens and assert that stdout and stderr contain no URLs, telephone numbers, contact handles, or promotional wording.
  7. Review all other runtime messages for similar documentation-to-implementation inconsistencies.

T09 · Insecure Skill Coding Practices

Warning
Location
src/utils/request.js:94
Finding

API Token Is Transmitted in URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:59-63,104-113; src/api/comment.js:38-42,67-72; src/api/post.js:23-27,50-55; src/api/hot.js:18-22; src/utils/request.js:94-120,123-140
Vulnerability Type: Sensitive credential exposure through URL query strings
Risk Level: Medium

Vulnerable Code

Representative caller from src/api/search.js:59-63:

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

Representative GET caller from src/api/search.js:104-113:

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

URL construction in src/utils/request.js:94-120:

js
async function postJson(path, params, data) {
  if (!path || typeof path !== "string") {
    throw new SkillError("PATH_INVALID", "path 必须是非空字符串");
  }
  if (!params || typeof params !== "object") {
    throw new SkillError("PARAM_INVALID", "params 必须是对象");
  }
  if (!data || typeof data !== "object") {
    throw new SkillError("DATA_INVALID", "data 必须是对象");
  }
  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);
}

URL construction in src/utils/request.js:123-140:

js
async function getJson(path, params) {
  if (!path || typeof path !== "string") {
    throw new SkillError("PATH_INVALID", "path 必须是非空字符串");
  }
  if (!params || typeof params !== "object") {
    throw new SkillError("PARAM_INVALID", "params 必须是对象
...[truncated 2815 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove token from all query-parameter objects.
  2. Send the credential through a dedicated authorization header, such as Authorization: Bearer TOKEN_VALUE, subject to the API's authentication protocol.
  3. If the remote API does not support header-based authentication, update the server and client together rather than continuing to expose credentials in URLs.
  4. Ensure request logging, exception reporting, and telemetry redact authorization headers and any legacy token query parameters.
  5. Rotate tokens that may already have appeared in server, proxy, gateway, or monitoring logs.
  6. Configure server and infrastructure logs not to retain sensitive query strings.
  7. Add tests that inspect generated request paths and fail if authentication credentials appear in a URL.
  8. Use a centralized authentication helper so all search, post, comment, and hot-list operations apply the same secure credential transport policy.
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 (49)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill states in the environment section that it does not write to the filesystem except logs, and later states that outputs are automatically saved under logs/. Automatic local persistence of scraped public data and query parameters is a real privacy and data-handling concern if users are not clearly warned up front, especially when URLs, keywords, and comments may contain sensitive business research context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill states in the environment section that it does not write to the filesystem except logs, and later states that outputs are automatically saved under logs/. Automatic local persistence of scraped public data and query parameters is a real privacy and data-handling concern if users are not clearly warned up front, especially when URLs, keywords, and comments may contain sensitive business research context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill states in the environment section that it does not write to the filesystem except logs, and later states that outputs are automatically saved under logs/. Automatic local persistence of scraped public data and query parameters is a real privacy and data-handling concern if users are not clearly warned up front, especially when URLs, keywords, and comments may contain sensitive business research context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill states in the environment section that it does not write to the filesystem except logs, and later states that outputs are automatically saved under logs/. Automatic local persistence of scraped public data and query parameters is a real privacy and data-handling concern if users are not clearly warned up front, especially when URLs, keywords, and comments may contain sensitive business research context.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares use of an environment variable token and network/API access, but it does not define an explicit tool scope such as permissions or allowed-tools. That makes the runtime trust boundary ambiguous and can allow broader-than-expected access to secrets or execution capabilities during invocation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generalized trigger explicitly says the skill should activate even when users do not mention Douyin, such as broad requests for short-video research or competitor analysis. This can cause unintended invocation, unnecessary external data collection, and exposure of user intent or research topics to third-party APIs without sufficiently specific user consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger list includes generic terms like 搜索, 评论, 作品, 主页, 账号, and 博主 without a strong platform qualifier. In a multi-skill environment, these broad cues can misroute unrelated requests into this skill, leading to unintended scraping actions or external requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill automatically saves collected data to local logs, but the user-facing description does not clearly warn about this persistence. Persisting comments, URLs, timestamps, and query terms can create avoidable privacy, retention, and confidentiality risks, particularly for market research or sensitive monitoring tasks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON schema uses Chinese-only natural-language titles and descriptions throughout, including the top-level title/description and property descriptions. Because SQP-3 applies to all file types and flags language/locale policy violations, this is a policy concern unless the skill explicitly offers language choice or documents a justified region-specific constraint, which is not present in this file.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language trigger examples use broad, colloquial phrases that can overlap with ordinary conversation, increasing the chance that an agent invokes the scraping skill when the user did not clearly request data collection. In this skill's context, mistaken activation can cause unintended third-party querying, token usage, and local storage of scraped results.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The intent-recognition rules define very broad activation terms such as '热点' and '今天什么火' with top priority, without requiring clear Douyin-specific scope. That makes accidental invocation more likely in general trend discussions, which is more dangerous here because the skill performs external data retrieval and may save results to disk automatically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The changelog and skill-facing descriptions are entirely in Chinese, which can impose a language requirement on users without explicit opt-in. Under the policy rule, forcing a specific language without offering a choice or clearly documenting a justified locale restriction is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code sends a skill token and user-supplied video URL to remote API endpoints via requestApi, which is a network operation involving potentially sensitive user or system data. Although the functions have developer-facing docstrings, there is no visible confirmation prompt, logging, or explicit user warning in this file about transmitting that data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This file includes natural-language comments and operation labels such as "抖音博主已发布作品模块", "创建任务", and "查询任务" exclusively in Chinese. The policy allows locale constraints only when the skill offers user choice or clearly documents a justified regional limitation, which is not present in this file.

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 a public Douyin data lookup and analysis tool, explicitly excluding login-protected private data. At L074 the code reads GUAIKEI_API_TOKEN from the environment, introducing credential handling that is not described or obviously required by the stated end-user purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The tool writes fetched comment results to a local JSON file after completing the lookup, creating persistent storage of potentially sensitive or regulated user-generated content. This expands data exposure beyond transient analysis: local files may be accessible to other users, included in backups, or retained longer than intended without the user's awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's user-facing strings, including status messages and comments describing behavior, are entirely in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-only audience. This creates a natural-language policy concern because the skill effectively forces a specific language without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code reads the sensitive environment variable GUAIKEI_API_TOKEN and then uses it to create and fetch remote post tasks. While the file logs URL handling and task status, it does not provide a user-facing warning or disclosure here that credentials will be consumed and network requests will be made.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The CLI persists fetched Douyin post results to a local JSON file after completing the request. This creates data retention beyond the user-visible lookup behavior and can expose scraped content, query targets, and metadata to other local users, backup systems, or downstream processes without explicit consent or retention controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The CLI silently writes fetched results to a local file after displaying them, without requiring explicit user approval. Even if the source data is public, the saved file aggregates targets, timestamps, and collected results in a durable artifact that may create privacy, compliance, or unintended disclosure risks on shared or monitored systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The CLI persists full search results and request metadata to a local JSON file without explicit user consent or a prominent warning. In this skill context, returned Douyin data and searched keywords may reveal sensitive research intent, customer targeting, or other business intelligence, and local persistence increases the risk of unintended disclosure on shared systems or through later log collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code contains user-facing status and error messages only in Chinese, such as the validation errors on these lines. For a general utility file with no documented locale restriction or opt-in, this creates a language policy concern because the skill implicitly forces one language on users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Several user-visible error messages are hard-coded in Chinese, including authentication guidance and failure text, with no indication that the language is configurable or opt-in. This can violate language/locale policy when the skill is expected to operate for users without a Chinese-language preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code emits all user-facing status and warning messages in Chinese, including the warning about token configuration and the info message about using a private token. Because the file provides no user language choice or documented region-specific justification, this is a natural-language locale policy issue under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This JavaScript file contains natural-language comments and multiple user-facing error/result messages exclusively in Chinese, such as the validation errors and formatted search output. Per the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.