Back to skill

Security audit

guaikei-douyin-live-data-puller

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but it has review-worthy issues around broad auto-activation, credential handling, promotional auth errors, and automatic local retention of collected data.

Install only if you are comfortable sending Douyin search terms, target account/video URLs, limits, and your GUAIKEI_API_TOKEN to the Guaikei service. Treat the token as sensitive, review local logs/ after use, and avoid using broad prompts that could trigger Douyin collection unintentionally. Prefer a version that narrows activation to explicit Douyin requests, moves the token to an Authorization header, removes runtime promotional/contact messages, and makes result logging opt-in.

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

Authentication failures inject prohibited promotional and contact information into runtime output

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:24-27; src/utils/request.js:51-55
Vulnerability Type: Runtime output manipulation and instruction-policy violation
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:51-55:

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

Technical Analysis

SKILL.md:37-39 explicitly requires authentication failures to produce only neutral errors and prohibits runtime contact details, external links, or promotional content. The implementation violates this declared constraint in two separate authentication-failure paths:

  1. A locally missing or malformed token prints the service website as a token-acquisition channel.
  2. An HTTP 401 or 403 response produces an AuthError containing a WeChat contact number.

CLI handlers copy error.message into stderr and structured JSON error output. An agent invoking the Skill can therefore relay the promotional or contact content as if it were a necessary operational instruction. This creates a predictable output-manipulation channel outside the Skill's declared data-retrieval purpose.

No evidence was found that these strings execute code, change system permissions, or establish persistence. The risk concerns agent-output integrity, user redirection, and violation of the Skill's explicit runtime behavior.

Attack Path

Local validation path:

  1. A user or agent invokes any CLI without GUAIKEI_API_TOKEN, or with a token that fails format validation.
  2. skillToken() detects the invalid token.
  3. The runtime prints www.guaikei.com as a token-acquisition channel.
  4. The invoking agent or interface may pr ...[truncated 1057 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace both authentication-failure messages with a fixed, neutral message such as GUAIKEI_API_TOKEN is missing or invalid; execution has stopped.
  2. Remove all websites, phone numbers, social-media contacts, acquisition instructions, and promotional text from runtime code.
  3. Return a stable machine-readable error code such as AUTH_REQUIRED without remote-service guidance.
  4. Ensure stdout contains only the documented JSON response and stderr contains only neutral diagnostics.
  5. Centralize authentication-error generation so local validation and HTTP 401/403 responses use the same sanitized message.
  6. Add automated tests that invoke every CLI with missing, malformed, expired, and unauthorized tokens and assert that output contains no URLs, phone numbers, contact handles, or promotional phrases.
  7. Keep token-enrollment and support information exclusively in static user documentation, as required by SKILL.md.

T09 · Insecure Skill Coding Practices

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

API credentials are transmitted in URL query strings

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:59-75,104-118; src/api/comment.js:38-51,67-78; src/utils/request.js:94-120
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: Medium

Vulnerable Code

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

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,
  data,
  constants.CREATE_MAX_ATTEMPTS,
  "创建任务",
);

src/api/search.js:104-118:

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,
  "查询任务",
);

src/api/comment.js:38-51:

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

const data = {
  url,
  limit,
};

return await requestApi(
  "POST",
  "/api/douyin/comment/url",
  params,
  data,
  constants.CREATE_MAX_ATTEMPTS,
  "创建任务",
);

src/api/comment.js:67-78:

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

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

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 必须是
...[truncated 3147 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove token from every URL parameter object.

  2. Transmit the credential through an HTTP authorization header, preferably:

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

  4. Ensure request logging, tracing, and exception handling redact Authorization, cookies, and any legacy token query parameter.

  5. Avoid placing sensitive user inputs in GET URLs when a POST body is operationally suitable.

  6. Configure the API gateway and reverse proxies to suppress or redact query strings in access logs.

  7. Rotate existing tokens that may already have been retained in URL logs.

  8. Add tests that intercept outgoing requests and assert that the path never contains token=.

  9. Apply short token lifetimes, scoped permissions, revocation support, and rate limits to reduce the impact of future credential disclosure.

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 (52)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the implementation truly lacks any Douyin search/browsing logic and instead reads local files or package metadata, the skill is materially misrepresented. A skill that claims online content collection but actually operates on local resources creates a serious trust violation and may expose local data under the guise of normal research activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation truly lacks any Douyin search/browsing logic and instead reads local files or package metadata, the skill is materially misrepresented. A skill that claims online content collection but actually operates on local resources creates a serious trust violation and may expose local data under the guise of normal research activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the implementation truly lacks any Douyin search/browsing logic and instead reads local files or package metadata, the skill is materially misrepresented. A skill that claims online content collection but actually operates on local resources creates a serious trust violation and may expose local data under the guise of normal research activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation truly lacks any Douyin search/browsing logic and instead reads local files or package metadata, the skill is materially misrepresented. A skill that claims online content collection but actually operates on local resources creates a serious trust violation and may expose local data under the guise of normal research activity.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description says the skill should activate even when the user does not mention Douyin, based on broad phrases like 'help me search' or 'what are people saying online.' Overbroad triggers are dangerous because they can hijack unrelated research requests, causing the agent to send user queries to an external service and consume credentials or network access outside the user's clear intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill explicitly relies on the environment variable GUAIKEI_API_TOKEN, but it does not declare a tool scope such as permissions or allowed-tools to make environment access explicit and reviewable. Undeclared access requirements weaken sandbox transparency and can cause the skill to receive secrets or runtime capabilities that were not clearly approved.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The generalized activation rule for multi-step research workflows broadens invocation beyond a clearly scoped Douyin task. In practice, this can cause silent routing of broad investigative tasks into a third-party data-pulling skill without explicit consent, increasing privacy, compliance, and least-surprise risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The line "纯中文界面" imposes a specific language/locale on users. Under the stated policy, forcing a language without opt-in is a natural-language policy violation unless the locale restriction is clearly justified and documented as region-specific.

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 uses Chinese-only natural-language titles and descriptions throughout, such as the title at L004 and descriptions for nearly every property. Because the file provides no opt-in, alternative locale, or statement that the skill is intentionally China/Chinese-language specific, it effectively enforces a single language and may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill should be used for searching Douyin videos, checking hot topics, reading comments, and viewing a creator's posts, and explicitly says it is not applicable to downloading videos. However, the schema documents play_addr as both a playback address and a '视频下载地址' (video download address), which expands the represented capability beyond the declared scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README advertises automatic JSON log generation for searches, posts, and comments, but it does not clearly warn that scraped content, target account/video identifiers, and user query terms will be persisted locally. This creates a data exposure risk because sensitive research topics, monitoring targets, or collected third-party content may remain on disk longer than users expect and could be accessed by other local users, backups, or downstream tooling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README tells users to configure GUAIKEI_API_TOKEN obtained from guaikei.com, which implies requests are sent to an external service, but it does not plainly disclose that the token and request parameters are transmitted off-box. This can mislead users about trust boundaries and cause unintended disclosure of search terms, target URLs, or operational metadata to a third-party provider.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The changelog explicitly adds bulk retrieval of an author's published works and collection of video comments, but provides no mention of privacy expectations, rate limits, consent boundaries, retention, or compliant handling of collected data. In a skill designed for search and analytics across a social platform, that omission increases the risk of misuse for profiling, surveillance, or large-scale scraping beyond reasonable user expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file's natural-language documentation and operation labels are entirely in Chinese, including user-facing request labels such as '创建任务' and '查询任务'. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern unless a locale-specific constraint is documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI persists fetched comment results to a local JSON file after completing a read-only query workflow. This creates undisclosed data retention of potentially sensitive or large-scale scraped content on disk, increasing exposure to local disclosure, unintended reuse, or policy violations, especially since the manifest describes a search/view capability rather than storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Comment data is written to a local file without any explicit warning, consent, or disclosure in this CLI flow. Even if the data is publicly sourced, silently storing user-requested results changes the privacy and security posture of the tool by leaving artifacts on disk that other local users, processes, or backup systems may access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

post.createPostTask and post.getPostTask are network/API operations that transmit the provided Douyin URL/sec_uid and request parameters. Although network access is central to the tool's purpose, this file does not explicitly disclose that the input will be sent to an external service, and the stated purpose does not name that external transmission behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Writing retrieved results to a local JSON file without clear user-facing notice introduces a privacy and data governance problem, especially since the skill may fetch third-party content users do not expect to be retained. In agent or multi-tenant environments, silent persistence can expose collected data to other processes, operators, or later compromise of the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The CLI persists full search results to a local log file automatically, but the user-facing flow does not clearly warn that queried keywords and returned content will be stored on disk. In this skill context, search terms and result data may reveal user interests, investigative topics, or sensitive monitoring activity, creating a privacy and local data-retention risk on shared or monitored systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JavaScript file contains natural-language comments and multiple user-facing strings entirely in Chinese, including errors and help text. Under the stated policy, forcing a specific language without user opt-in or documented regional justification is a locale-policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file contains user-visible error text in Chinese (请求失败) and elsewhere uses Chinese-only operational messages, with no indication that the user can choose another language. That creates a locale/language policy concern because the skill appears to force a specific language rather than offering opt-in 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
96% confidence
Finding

The auth failure string is entirely in Chinese and directs users to Chinese-language support text, without any user opt-in for locale. This is a direct natural-language policy issue because the skill imposes a language choice in a user-facing error path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code presents all user-facing messages in Chinese only, including warnings and status output. Because there is no indication of user opt-in, language selection, or a documented China-specific constraint, this appears to violate the language/locale policy for natural-language content.

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 multiple user-facing validation and output strings in Chinese, such as error messages and formatted result labels. Under the language/locale policy, forcing a specific language without user opt-in or documented regional justification 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
91% confidence
Finding

The title and description fields use Chinese-language text exclusively, which can amount to a language/locale policy issue when no user opt-in or documented locale constraint is provided. Because this is a natural-language issue in schema metadata rather than a runtime safety behavior, the impact is limited but still relevant under the policy rule.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.