Back to skill

Security audit

guaikei-douyin-competitor-watch

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its Douyin research purpose, but it has review-level concerns around auth-error marketing, broad activation, third-party data flow, and token handling.

Review before installing. Use it only for non-sensitive Douyin research, assume keywords and target URLs go to Guaikei, avoid ambiguous invocations, and be aware that successful runs save JSON results locally. The publisher should remove runtime marketing/contact output and move token authentication out of URL query strings before this is treated as routine.

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:24
Finding

Hard-Coded Promotional Messaging Injected into Authentication Error Output

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:24-35; src/utils/request.js:50-55
Vulnerability Type: Runtime output manipulation through authentication handling
Risk Level: High

Vulnerable Code

src/utils/token.js:24-35:

js
if (!isValidToken(token)) {
  utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. ");
  utils.printError("一键解锁全部功能, 即刻恢复高效办公!");
  utils.printInfo(
    "获取您的专属私有TOKEN, 一键配置即可永久稳定使用, 完全不影响日常办公。",
  );
  utils.printSuccess("\t快速获取通道: www.guaikei.com");
  utils.printSuccess("\t专属客服微信: 13395823479");
  utils.printError("早配置早享受, 别让工具问题耽误您的宝贵时间!");
  return "";
}

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

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 specification requires authentication failures to produce only a neutral error and explicitly prohibits runtime contact details, external links, marketing language, and payment guidance. The implementation directly violates those restrictions.

When the locally supplied token is absent or malformed, skillToken() writes multiple promotional messages, an external domain, and a WeChat contact to stderr. When the remote service returns HTTP 401 or 403, the contact information is embedded in an AuthError.

CLI error handlers subsequently assign error.message to structured JSON output. For example, src/douyin/search-cli.js:171-200 writes the authentication error message to stdout. Consequently, the promotional contact can become part of machine-consumable output rather than remaining an internal diagnostic.

This behavior is classified as instruction or output hijacking because the skill substitutes attacker-selected solicitation content for the neutral authentication response promised by its instructions. It ca ...[truncated 1344 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove all marketing language, contact information, external URLs, and acquisition guidance from runtime source code.
  2. Replace local token-validation output with a fixed neutral message such as:
    text
    GUAIKEI_API_TOKEN is missing or has an invalid format. The skill has stopped.
    
  3. Replace HTTP 401 and 403 messages with a stable error code such as AUTH_REQUIRED and a neutral description.
  4. Ensure structured stdout never contains promotional text supplied by local code or an untrusted remote API.
  5. Map remote authentication failures to locally controlled messages rather than forwarding server-provided error text.
  6. Add automated tests covering missing, malformed, expired, and rejected tokens. Tests should assert that stdout and stderr contain no contact details, marketing language, or external URLs.
  7. Keep token acquisition instructions exclusively in user-facing documentation, as required by SKILL.md.

T09 · Insecure Skill Coding Practices

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

API Credentials Transmitted in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:94-107,122-132; src/api/search.js:58-73,103-115; src/api/comment.js:37-48,66-74; src/api/post.js:22-31,49-56; src/api/hot.js:18-23
Vulnerability Type: Sensitive credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

Representative token construction in src/api/search.js:58-73:

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

const data = {
  keyword,
  sort_type: sort,
  publish_time: time,
  filter_duration: duration,
  content_type: content,
  limit: limit,
};

return await requestApi(
  "POST",
  "/api/douyin/general-search/keyword",
  params,

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

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

GET URL construction in src/utils/request.js:122-132:

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

The same token pattern is used by the search, comment, post, and hot-list API modules.

Technical Analysis

GUAIKEI_API_TOKEN is added to a params object and serialized directly into the HTTP request path. Although the request uses HTTPS, transport encryption does not prevent the URL from being retained after it reaches the remote infrastructure.

Query strings are commonly captured by:

  • Reverse-proxy and web-server access logs
  • API ga ...[truncated 1813 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the token from all URL query parameters.
  2. Transmit credentials through a dedicated authorization header, for example:
    js
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
      "Accept-Encoding": "identity",
    }
    
  3. Refactor the request interface so credentials are passed separately from ordinary query parameters and cannot be serialized into URLs accidentally.
  4. Use POST request bodies for user-supplied keywords and target URLs where the remote API design permits it.
  5. Configure reverse proxies, API gateways, application logs, and monitoring tools to redact authorization headers and sensitive request fields.
  6. Review historical URL logs for exposed credentials and delete or securely restrict those records.
  7. Rotate all tokens that may previously have been transmitted in query strings.
  8. Add tests that inspect generated request paths and fail if parameters named token, api_key, secret, or equivalent credentials appear in the URL.
  9. Apply short token lifetimes, revocation support, rate limits, and least-privilege scopes to reduce the effect of future credential exposure.
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 (44)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the underlying code outputs promotional or contact information when token validation fails, that contradicts the skill's stated neutral error-handling policy and may socially engineer operators into disclosing context or obtaining off-platform credentials. Combining secret handling with misleading auth flows raises the risk of phishing-style redirection and accidental token exposure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill explicitly relies on an environment variable token (GUAIKEI_API_TOKEN) and Node execution, but the manifest does not declare tool scope or permissions. That creates a trust gap: reviewers and orchestrators cannot accurately constrain or reason about the skill's access to secrets and execution capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are intentionally broad enough to activate on generic phrases like '查一下' or '帮我看看' even when Douyin is not mentioned. That can cause the agent to invoke an external data-collection skill in contexts the user did not intend, leading to unnecessary transmission of user queries or target identifiers to the skill/backend.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Allowing activation without naming Douyin creates ambiguous scope and increases the chance of cross-context invocation. In practice this can route unrelated user requests into a third-party data retrieval flow, exposing user intent, URLs, or identifiers beyond what was necessary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This JSON schema contains human-readable title and description strings exclusively in Chinese, including the top-level metadata and all property descriptions. Because this file provides natural-language interface/schema documentation and does not offer a language option or justify a Chinese-only locale restriction, it may violate a language/locale policy requiring user choice or explicit documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README says data export and JSON logs are generated, but it does not clearly warn near the main usage flow that scraped data is saved locally by default. Because the skill collects potentially sensitive competitor, comment, and hotspot data at scale, silent persistence can create unintended retention, local disclosure, or accidental sharing risks for users who assume results are ephemeral.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill requires a third-party token and sends search keywords, target profile URLs, and video URLs to an external service, but the README does not prominently disclose this data flow or its privacy implications. Users may unknowingly transmit sensitive research targets, monitoring interests, or internal investigation context to a vendor-controlled backend, creating privacy, confidentiality, and compliance risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The changelog is entirely presented in Chinese, and there is no indication that users can opt into another language or that the skill is intentionally limited to a Chinese-only audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly documents bulk collection of Douyin creator posts and comments up to 10,000 records, but provides no guidance on privacy, lawful basis, rate limiting, retention, or handling of personal data. In a competitor-watch context, this increases the risk of large-scale profiling, over-collection, and misuse of user-generated content and account data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The CLI persists fetched comment results to a local JSON file after completing a read/query operation, which expands the data lifecycle beyond the user's apparent request. Comment content can contain personal data, usernames, or sensitive text, and silent local retention increases privacy, compliance, and unintended disclosure risk if logs are later accessed, synced, or mishandled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The tool writes retrieved comment data to a local file without any user-facing warning in this file, creating an undisclosed persistence channel for potentially sensitive third-party content. In a skill framed as search/watch functionality, silent storage is more dangerous because users may reasonably expect transient querying rather than durable collection.

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 contains user-facing natural-language strings such as status messages and errors exclusively in Chinese, and there is no indication that the user can choose another language or opt in to this locale. That can violate language/locale policy when a skill imposes a specific language by default.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The CLI persists fetched Douyin post results to a local JSON file after completing the user-requested query, which adds undisclosed data-retention behavior beyond simple retrieval. Even if the content is not highly sensitive by itself, silently writing collected competitor/watch data to disk can expose browsing targets, harvested content, and query history to other local users, later processes, or accidental uploads.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code writes the full query result set to a local JSON file without any user-facing warning or consent in this file. This creates a privacy and data-governance issue because users may expect a read-only competitor-watch action, while the tool actually leaves behind persistent artifacts containing URLs, limits, timestamps, and fetched results.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Multiple user-visible strings, including API error messages, timeout/network errors, and retry logs, are hard-coded in Chinese with no indication of locale choice or opt-in. Under the language/locale policy, forcing a specific language without offering the user a choice is a natural-language policy violation.

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 includes user-facing title and description fields exclusively in Chinese, which imposes a specific language on downstream users or tools without any opt-in or alternative locale. The file does not document that the skill is intentionally region-specific or limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This JSON schema contains human-readable title and description fields entirely in Chinese, including field descriptions across the schema. For a general-purpose skill artifact, this imposes a specific language/locale in natural-language content without any opt-in or documented region-specific justification, which matches the language policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This JSON schema uses Chinese-only natural-language titles and descriptions throughout, which can constitute a language/locale policy issue when no opt-in or justification is provided. Because the file is a general schema rather than an explicitly region-specific configuration, the locale restriction appears implicit rather than documented.

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 entirely in Chinese, including parameter descriptions, but does not indicate that the skill is region-specific or that users may choose another language. Under the language/locale policy rule, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.