Back to skill

Security audit

guaikei-douyin-collection

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its Douyin data-collection purpose, but it has review-worthy issues around hidden authentication-error promotion, token handling, broad triggers, and automatic local data retention.

Install only if you are comfortable sending Douyin search terms, profile/video URLs, and a GUAIKEI_API_TOKEN to the vendor service, and with result datasets being saved locally by default. Treat collected comments and account data as personal or sensitive business data, review the logs directory regularly, and be aware that invalid-token paths may show vendor contact details despite the skill claiming they will not.

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

Deceptive Promotional Content Injected into Authentication Errors

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:24-27 and src/utils/request.js:50-55
Vulnerability Type: Runtime behavior contradicts the declared authentication-error policy
Risk Level: High

Vulnerable Code

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

js
if (!isValidToken(token)) {
  utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. ");
  utils.printSuccess("\t快速获取通道: www.guaikei.com");
  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

SKILL.md:31-47 explicitly states that invalid-token failures must produce only neutral error messages. It specifically prohibits website links, WeChat contact information, and marketing language in runtime output.

The executable implementation contradicts that declaration in two separate authentication paths:

  1. Local token-format validation prints the vendor website as a token acquisition channel.
  2. HTTP 401 and 403 responses produce an AuthError containing a WeChat telephone number and promotional wording.

CLI error handlers subsequently print and serialize error.message, so the contact information can be included in both diagnostic output and structured JSON returned to the caller. This is not merely documentation contained in a user guide; it is runtime content triggered during normal Skill execution.

The discrepancy conceals the effective runtime behavior from users and reviewers. Loading and following the Skill's declared workflow can therefore cause the agent to relay unsolicited vendor contact information.

Attack Path

  1. A user invokes any documented search, post, comment, or trending-data command.
  2. GUAIKEI_API_TOKEN is absent, malformed, expired, or rejected by the remote service.
  3. For a ...[truncated 893 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove all website addresses, telephone numbers, social-media contacts, and token-acquisition language from runtime errors.
  2. Replace the local validation output with a neutral message such as: GUAIKEI_API_TOKEN is missing or invalid. Execution has stopped.
  3. Replace the HTTP 401 and 403 message with a stable error code and neutral explanation, without remote contact instructions.
  4. Ensure all four CLI handlers map authentication failures to the same sanitized error object and exit code.
  5. Add automated tests that invoke both local validation failures and simulated HTTP 401/403 responses.
  6. Assert that authentication-error output contains no URL, telephone number, social contact, or marketing phrase.
  7. Keep acquisition and support information, if necessary, exclusively in clearly identified user documentation rather than runtime output.

T09 · Insecure Skill Coding Practices

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

API Token Transmitted in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:57-62,102-108, src/api/comment.js:37-41,66-71, src/api/post.js:22-26,49-53, src/api/hot.js:19-22, and src/utils/request.js:106-112,128-136
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: Medium

Vulnerable Code

Representative token construction in src/api/search.js:57-62:

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

Query-string serialization in src/utils/request.js:106-112:

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

const options = {
  host: constants.BASE_URL,
  path: fullPath,
  method: "POST",

The same pattern is used for GET requests in src/utils/request.js:128-136:

js
params._ = Date.now();

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

Technical Analysis

The API modules insert GUAIKEI_API_TOKEN into the params object for search, post, comment, and hot-list operations. postJson() and getJson() serialize the entire object into the request URL using querystring.stringify().

HTTPS encrypts the URL while it is in transit, but it does not prevent the URL from being retained by infrastructure that terminates or processes the request. Full URLs are commonly recorded by reverse proxies, load balancers, web-server access logs, application performance monitoring systems, debugging tools, and error telemetry.

Because the credential is embedded in the query string, any such URL record may contain a reusable API token. Query parameters can also be exposed more broadly than authentication headers during operational troubleshooting.

Attack Path

  1. The user configures a valid GUAIKEI_API_TOKEN.
  2. A CLI entry ...[truncated 982 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove token from every query-parameter object.
  2. Transmit the credential in an HTTP authorization header, such as Authorization: Bearer <token>, subject to the server's supported authentication scheme.
  3. Centralize credential attachment in request.js so API modules cannot accidentally place tokens in URLs.
  4. Ensure request, proxy, and application logs redact authorization headers and never serialize credential values.
  5. Add tests that inspect constructed request paths and fail if they contain token, access_token, or the configured credential value.
  6. Review server, proxy, and telemetry logs for previously recorded tokens.
  7. Rotate credentials that may already have been retained in URL logs.
  8. Apply limited scopes, quotas, expiration, and revocation support 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 (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The broader mismatch matters here because the skill advertises analytical behavior while also accessing the local filesystem in a way not central to the user-facing description. Hidden or weakly disclosed side effects reduce auditability and can cause users to trust the skill for one purpose while it persists operational data locally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The broader mismatch matters here because the skill advertises analytical behavior while also accessing the local filesystem in a way not central to the user-facing description. Hidden or weakly disclosed side effects reduce auditability and can cause users to trust the skill for one purpose while it persists operational data locally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The broader mismatch matters here because the skill advertises analytical behavior while also accessing the local filesystem in a way not central to the user-facing description. Hidden or weakly disclosed side effects reduce auditability and can cause users to trust the skill for one purpose while it persists operational data locally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The broader mismatch matters here because the skill advertises analytical behavior while also accessing the local filesystem in a way not central to the user-facing description. Hidden or weakly disclosed side effects reduce auditability and can cause users to trust the skill for one purpose while it persists operational data locally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The broader mismatch matters here because the skill advertises analytical behavior while also accessing the local filesystem in a way not central to the user-facing description. Hidden or weakly disclosed side effects reduce auditability and can cause users to trust the skill for one purpose while it persists operational data locally.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares use of an environment variable token but does not define an explicit tool/permission scope such as env access. That creates an under-specified trust boundary: a reviewer or orchestrator cannot clearly tell that secret access is required, increasing the risk of overbroad execution or unintended secret exposure in environments that rely on manifest-style declarations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This JSON schema contains natural-language titles and descriptions only in Chinese, including the top-level title/description and property descriptions. Because the file provides no opt-in, alternative locale, or explicit justification that the skill is region-specific, it appears to impose a specific language/locale by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JSON schema uses Chinese-only natural-language titles and descriptions such as the title and field descriptions, with no indication that the skill is region-specific or that users can choose another language. Per the policy, forcing a specific language without 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
89% confidence
Finding

The skill advertises one-click collection of public videos, author data, comments, and hot-list data, and notes that JSON logs are stored locally, but it provides only minimal guidance on privacy, retention, consent, and downstream handling. Even for public data, bulk aggregation and persistent logging can create privacy, compliance, and misuse risks, especially for comment content and account-level profiling.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README maps very broad natural-language phrases such as "搜索 / 搜一下 / 找" and hotspot-related everyday expressions directly to command execution. In an agent setting, these overlapping triggers increase the chance of unintended tool invocation from ordinary conversation, causing unreviewed collection of third-party Douyin data and creation of local logs without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The intent-recognition rules prioritize ambiguous keywords like "热搜 / 热点 / 榜单 / 今天什么火" and "搜索 / 找" with limited constraints. In practice, an agent may over-trigger this skill on generic requests, leading to data retrieval, token-backed API usage, and storage of scraped content even when the user did not clearly request Douyin collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The changelog title is presented in Chinese as the primary language, with only an English parenthetical subtitle, and the file contains no indication that language choice is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation is written entirely in Chinese and specifies parameters and usage examples only in that language, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, a skill that effectively enforces a language/locale without opt-in or justification 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
95% confidence
Finding

The CLI writes fetched comment results to a local JSON file automatically after successful execution, without obtaining explicit user consent or providing a clear warning that potentially sensitive third-party content will be persisted on disk. In this skill’s context, comment data may contain personal data, usernames, opinions, or other sensitive marketing intelligence, so silent local retention increases privacy, compliance, and data exposure risk if the host is shared or compromised.

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 the user-supplied URL, limit, and API token to external functions that create and retrieve a remote task. While the CLI logs the URL locally, it does not clearly disclose to the user that their input is being transmitted to an external service, which is a safety-relevant network operation for a code file.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The CLI persists the full fetched post dataset to a local JSON file after completing the request. This creates a secondary copy of potentially sensitive or regulated content and metadata without any retention controls, user consent prompt, or indication in the tool description, increasing the risk of unintended data accumulation and later disclosure from disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The CLI writes full search results to a local JSON file automatically, with no explicit user consent or prominent warning. Because this skill processes marketing research data and may capture sensitive business queries, account analysis targets, or reputation-related content, silent persistence can expose data to other local users, backup systems, or later compromise of the host.

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 natural-language comments and user-visible messages such as errors and help text entirely in Chinese. That forces a specific language/locale on users of the CLI without offering a language choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The authentication error string is hard-coded in Chinese, including the remediation guidance, with no indication that the skill supports language choice or that the locale is intentionally region-specific. This can violate language/locale policy because users are forced into one language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown states '纯中文界面', which indicates the skill is constrained to Chinese language output/interface. Under the policy rules, forcing a specific language without offering a user choice or documenting an opt-in 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 contains user-facing title and description strings entirely in Chinese, including parameter descriptions, with no indication that the skill supports other languages or that Chinese is an intentional opt-in locale. That can violate a language/locale policy when the skill is not clearly documented as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This JSON schema contains natural-language titles and descriptions exclusively in Chinese, including the top-level title/description and each property description. For a generally reusable skill asset, forcing a single language without documenting locale constraints or user opt-in can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The title and description are written only in Chinese, which can imply a fixed language/locale requirement in the skill artifact. The file does not indicate that the schema is intentionally China/Chinese-specific or that other language options are supported, which may violate a language-choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This manifest-style JSON schema contains user-facing natural-language strings only in Chinese, including the title and field descriptions. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation unless the region-specific constraint is explicit and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This JSON schema uses Chinese-only natural-language titles and descriptions throughout, such as the top-level title/description and every property description. Because the file provides no indication that language selection is optional or region-specific, it may violate a language/locale policy that requires user choice or explicit justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.