Back to skill

Security audit

Guaikei Douyin Competitor Watch

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but its runtime credential handling and auth-error messages need review before installation.

Install only if you are comfortable with a third-party Guaikei API receiving your Douyin queries and token, and with scraped public results being saved locally under logs. Treat the runtime support contact in auth errors as untrusted until the package is corrected, and prefer a version that sends tokens via headers and offers explicit logging controls.

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/request.js:51
Finding

Hard-Coded Runtime Contact Promotion in Authentication Errors

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:51-55
Vulnerability Type: Runtime output manipulation and unauthorized contact redirection
Risk Level: High

Vulnerable Code

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

The resulting message is propagated into CLI output. For example, src/douyin/search-cli.js:174-199 contains:

js
} catch (error) {
  utils.printError(`搜索失败: ${error.message}`);
  const errorOutput = {
    status: "error",
    error_code: error.code || "UNKNOWN",
    message: error.message,
    timestamp: new Date().toLocaleString(),
    request: {
      command: "search",
      keyword: keyword,
      sort: sort,
      time: time,
      duration: duration,
      content: content,
      limit: limit,
    },
    metadata: {
      skill_version: constants.VERSION,
      runtime_version: process.versions.node,
      execution_time: Date.now() - startTime,
    },
    results: null,
  };
  const exitCode = error.name === "AuthError" ? 3 : 1;
  process.stdout.write(JSON.stringify(errorOutput, null, 2) + "\n", () =>
    process.exit(exitCode),
  );
  return;
}

Technical Analysis

The implementation embeds an external contact identifier in an authentication error and places that message in both diagnostic output and the structured JSON response. An agent invoking the skill may treat the returned message as trusted operational guidance and relay it directly to the user.

This behavior directly contradicts the declared policy in SKILL.md, which states that authentication failures must produce only a neutral error and must not display contact details, website links, marketing language, or payment guidance at runtime.

Although this issue does not provide operating-system privileges or arbitrary code execution, it changes the agent-visible behavior of the ...[truncated 1450 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the authentication error with a neutral message that contains no contact information, URLs, sales language, or payment instructions.
  2. Use a stable error code such as AUTH_REQUIRED and keep the user-facing message limited to checking the configured environment variable.
  3. Ensure all CLI handlers map AuthError to the same neutral response and exit code 3.
  4. Avoid returning raw upstream or internal error messages directly in agent-consumable JSON.
  5. Add automated tests that simulate HTTP 401 and 403 responses and assert that output contains no phone numbers, contact handles, URLs, or promotional language.
  6. Add a centralized error-sanitization layer before messages are written to stdout or stderr.
  7. Review all runtime messages for consistency with the restrictions declared in SKILL.md.

T09 · Insecure Skill Coding Practices

Warning
Location
src/api/search.js:59
Finding

API Token Exposed in HTTPS Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:59-62, src/api/search.js:104-107, src/api/comment.js:38-41, src/api/comment.js:67-70, and analogous post and hot API calls; serialized by src/utils/request.js:105-112 and src/utils/request.js:127-136
Vulnerability Type: Sensitive credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

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

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

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,
};

src/utils/request.js:105-120:

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

src/utils/request.js:127-140:

js
params._ = Date.now();

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

return await request(options);

Technical Analysis

The API modules place GUAIKEI_API_TOKEN into the params object. Both postJson and getJson serialize the entire object into the URL query string with querystring.stringify.

HTTPS encrypts the request while it is in transit, but it does not prevent the complete request URL from being recorded at endpoints or infrastructure that terminates TLS. Query strings are commonly retained in:

  • Web-server and reverse-proxy access logs.
  • API gateway telemetry.
  • Load-balancer logs.
  • Application performanc ...[truncated 1834 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the token from every URL query parameter.
  2. Transmit it through an authorization header, preferably:
    js
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
      "Accept-Encoding": "identity",
    }
    
  3. If the service cannot support authorization headers immediately, place the credential in a protected POST body as a temporary measure and avoid credential-bearing GET requests.
  4. Update all search, post, comment, and hot-list endpoints consistently.
  5. Configure reverse proxies, API gateways, monitoring systems, and application logs to redact authentication headers and any legacy token query parameter.
  6. Rotate tokens that may already have appeared in access logs or telemetry.
  7. Add tests that inspect generated request paths and fail if token, api_key, or similar sensitive fields appear in a URL.
  8. Avoid including complete request URLs in exception messages and debug output.
  9. Apply least-privilege scopes, expiration, revocation, and usage-rate limits to API tokens to reduce the impact of future disclosure.
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 (51)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Undeclared local filesystem logging is materially security-relevant because persisted logs may store user queries, target URLs, error details, or API interaction metadata beyond what the user expects. In a data-collection skill, silent persistence increases privacy and retention risk even if the skill does not claim to handle private data.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill declares environment variable use (GUAIKEI_API_TOKEN) and Node execution behavior but does not expose explicit permissions or allowed-tools scope. That creates an under-specified trust boundary: an orchestrator may grant broader capabilities than users or reviewers expect, especially around env access and command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger description is broad enough to match common 'video/data/hot topic' requests without tightly constraining Douyin-specific context. Overbroad activation can cause the agent to invoke a tokenized external-data skill in situations the user did not intend, increasing unnecessary data exposure, API use, and mis-scoped execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly says it should be used even when the user does not mention Douyin, which weakens invocation boundaries and raises the chance of accidental execution on unrelated requests. In a skill that uses environment-provided credentials and external data retrieval, ambiguous activation broadens the blast radius of misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The natural-language description forces a specific language/locale presentation for the skill metadata, which can violate language choice expectations when no opt-in or justification is provided. There is no indication that this skill is intentionally limited to Chinese-speaking users or a China-specific compliance context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The README explicitly promotes automatic JSON log export of scraped results, including comments and other potentially sensitive public data, but does not prominently warn users that collected data will be stored locally and may accumulate in the logs directory. This increases the risk of unintended retention, secondary disclosure, or mishandling of scraped personal content, especially in shared workstations, synced folders, or CI environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The README instructs users to place GUAIKEI_API_TOKEN in an environment variable but does not provide an upfront credential-handling warning where setup first appears. While environment variables are common, the omission can still lead to unsafe practices such as copying tokens into shell history, screenshots, shared terminal sessions, or improperly scoped runtime environments.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language trigger mapping uses broad conversational phrases such as general requests to search, inspect a video, or see what people are saying, which can cause the skill to activate on ambiguous user input. In this skill's context, unintended invocation can trigger scraping of third-party data and produce local logs, creating privacy, consent, and data-minimization concerns even without explicit malicious intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The intent recognition rules prioritize broad keywords like '热搜 / 热点 / 榜单 / 今天什么火' with limited exclusion logic, making accidental activation plausible during ordinary conversation. Because this skill performs external data collection from Douyin and may save results to disk, false activations have more security and privacy consequence than a harmless informational tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file uses Chinese throughout the title and changelog entries, and does not indicate that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

技能清单将用途限定为当用户提到抖音/短视频平台中的视频、博主、热搜话题并想获取数据时使用,且强调不处理其他平台、偏向视频/博主/话题数据查询。L5 的“提供抖音通用搜索接口,支持视频、图文、用户及社交数据搜索”表述明显比该目的更宽,暗示一个通用抖音搜索能力而非竞品观察式数据获取。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file documents bulk collection of Douyin comments and creator content, including up to 10,000 items, but provides no privacy, consent, retention, or terms-of-service guidance. In a competitor-watch analytics skill, this omission materially increases the risk of misuse for profiling, surveillance, or non-compliant scraping of user-generated content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This file’s natural-language content, including module and parameter descriptions, forces a specific language locale without indicating that users or maintainers can choose another language. Under the policy, language-specific behavior or instructions without opt-in can constitute a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file's natural-language documentation and status strings are entirely in Chinese, including operation labels like '创建任务' and '查询任务'. Under the stated policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The string '创建任务' appears to be a user-visible or operational label passed into the request helper, and it is hard-coded in Chinese. There is no indication in this file that users can opt into that locale or switch languages.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The string '查询任务' is hard-coded in Chinese and appears to be used as a user-visible or operational message. The file does not provide any opt-in, fallback, or documented justification for enforcing this language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code persists the full command output, including request metadata and retrieved comments, to disk via log.taskWrite. Although the CLI prints status messages, there is no clear user-facing disclosure here that results will be saved locally as a file, which can affect user data handling and privacy expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The CLI writes the full scraped results object to a local JSON file automatically, without explicit user consent, retention controls, or any warning that data will be persisted on disk. Because this skill collects Douyin account/video data and associated metadata, automatic local storage can create unintended data exposure through shared machines, backups, log collection, or later compromise of the host.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.