Back to skill

Security audit

guaikei-douyin-search-and-analyze

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but it has review-worthy issues around broad activation, token handling, runtime solicitation, and automatic local logs.

Review before installing. Use this only for explicit Douyin research, assume keywords, Douyin URLs, IDs, and your GUAIKEI_API_TOKEN are sent to Guaikei, and treat the token as sensitive because this version places it in URLs. Expect JSON result files under the skill's logs directory and delete them when no longer needed. Be aware that invalid-token paths can display contact/marketing text despite the skill's own documentation saying they should 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

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

Runtime Marketing and Contact Solicitation Contradicts the Declared Authentication-Failure Policy

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:23-38; supporting occurrence at src/utils/request.js:50-56
Vulnerability Type: Runtime instruction and output manipulation
Risk Level: Medium

Evidence

javascript
function skillToken(token) {
  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 "";
  }

  utils.printInfo("已使用配置的私有TOKEN");
  return token;
}

A second runtime solicitation is embedded in the HTTP authentication-error path:

javascript
} 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 explicitly states that an invalid token must produce only a neutral error, and that runtime output must not contain contact details, website links, payment guidance, or marketing language. The implementation deliberately violates that declared behavior.

When a token is absent or fails local format validation, skillToken() emits promotional language, a website, and a personal contact number to standard error. When the remote service returns HTTP 401 or 403, the resulting AuthError also includes the contact number. CLI handlers subsequently relay error.message into logs and structured output, so this remotely triggered branch can expose the solicitation through both human-readable and machine-readable channels.

Although this does not execute arbitrary operating-system commands, it hijacks the expected authentication-failure int ...[truncated 1556 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the invalid-token branch with one neutral message, such as: GUAIKEI_API_TOKEN is missing or has an invalid format; execution has stopped.
  2. Remove all website addresses, contact details, urgency language, and promotional statements from runtime code.
  3. Replace the HTTP 401/403 message with a neutral authentication error that does not direct users to any third party.
  4. Ensure every CLI maps authentication failures to exit code 3 without copying promotional or remotely supplied content into stdout.
  5. Keep token-acquisition instructions exclusively in clearly identified user documentation.
  6. Add automated tests asserting that missing, malformed, expired, and rejected tokens never produce URLs, phone numbers, contact handles, or marketing phrases.
  7. Add tests verifying that stdout remains valid schema-conforming JSON and stderr contains only operational diagnostics.
  8. Review all server-provided errmsg values before relaying them to users; map known API errors to locally controlled neutral messages.

T09 · Insecure Skill Coding Practices

Error
Location
src/api/search.js:50
Finding

Authentication Tokens Are Transmitted in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:50-77 and src/api/search.js:95-120; URL construction at src/utils/request.js:94-118
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: High

Evidence

The search task places the token in the URL parameter object:

javascript
async function createSearchTask(
  token,
  keyword,
  sort,
  time,
  duration,
  content,
  limit,
) {
  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,
    "创建任务",
  );
}

The result request repeats the token and user query in a GET query string:

javascript
async function getSearchTask(
  token,
  keyword,
  sort,
  time,
  duration,
  content,
  limit,
) {
  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,
    "查询任务",
  );

The shared request utility serializes every parameter, including token, into the request target:

javascript
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
...[truncated 3570 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove token from every query-parameter object.
  2. Transmit the credential in an HTTP authorization header, preferably Authorization: Bearer <token>.
  3. If the server supports a dedicated authentication scheme, use a purpose-specific header with equivalent redaction controls.
  4. Update both postJson() and getJson() so authentication is accepted separately from ordinary request parameters and is never appended to fullPath.
  5. Configure reverse proxies, API gateways, application servers, and observability platforms to redact authorization headers and sensitive request data.
  6. Rotate all tokens that may previously have appeared in URL logs.
  7. Review and purge retained access logs, traces, analytics data, and error reports containing token= where operationally and legally appropriate.
  8. Avoid placing user-sensitive search terms and target URLs in GET query strings when they can be sent in POST bodies.
  9. Add tests that inspect generated request paths and fail if they contain token, secret, or equivalent credential parameters.
  10. Apply token scoping, expiration, revocation, rate limiting, and anomaly detection to reduce the effect of credential replay.
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 (45)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation explicitly forbids outputting contact information or token-purchase guidance at runtime, so code that emits private token acquisition or promotional content would directly violate stated security requirements. This can facilitate credential solicitation, social engineering, or off-platform exfiltration disguised as error handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation explicitly forbids outputting contact information or token-purchase guidance at runtime, so code that emits private token acquisition or promotional content would directly violate stated security requirements. This can facilitate credential solicitation, social engineering, or off-platform exfiltration disguised as error handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation explicitly forbids outputting contact information or token-purchase guidance at runtime, so code that emits private token acquisition or promotional content would directly violate stated security requirements. This can facilitate credential solicitation, social engineering, or off-platform exfiltration disguised as error handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documentation explicitly forbids outputting contact information or token-purchase guidance at runtime, so code that emits private token acquisition or promotional content would directly violate stated security requirements. This can facilitate credential solicitation, social engineering, or off-platform exfiltration disguised as error handling.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Saying the skill should activate even when the user does not mention Douyin makes the trigger condition overly broad and increases the chance the skill is invoked for unrelated requests. In a system that can access environment tokens, network resources, and local logs, overbroad activation can route sensitive or irrelevant user tasks into a higher-capability workflow than intended.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

Repeating that the skill should be used without explicit Douyin mention reinforces ambiguous routing boundaries and makes accidental or inappropriate invocation more likely. This is especially risky because the skill uses authentication and performs external data retrieval/logging, so mistaken activation expands data handling beyond user intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill documents use of an environment variable token but does not declare an explicit tool/permission scope for environment access. This creates hidden capability expansion: a host may expose environment data more broadly than intended, and reviewers cannot easily verify least-privilege boundaries.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Common phrases like '搜一下', '找 XX', or '今天什么火' are too generic to safely distinguish this skill from ordinary search or trend-analysis tasks. Ambiguous triggers can cause privilege overreach by selecting a specialized skill with token use and logging behavior for broad, non-Douyin requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The title and field descriptions consistently force a Chinese-language interface and documentation context, but the file provides no indication that this locale is optional or intentionally limited to a Chinese-only audience. Under the policy, hard-coding a specific language without user opt-in or documented justification 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
97% confidence
Finding

The schema explicitly documents video_url as containing both playback and download URLs, which conflicts with the skill description stating it is not for downloading videos. This mismatch can enable downstream components or users to use the skill for prohibited content acquisition, expanding the skill beyond its declared and likely approved scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest explicitly limits the skill to searching and analyzing public Douyin data and says it is not used for downloading videos. This schema defines play_addr as a "视频播放地址、视频下载地址", indicating the skill exposes a downloadable video address in its outputs, which exceeds the stated non-download scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README says logs are generated and mentions output files later, but it does not prominently warn users up front that fetched Douyin data, including comments and account/video identifiers, will be stored locally in the logs directory. In a skill focused on public-data collection and sentiment analysis, silent local persistence can expose sensitive business research, user queries, and scraped content to other local users, backups, or downstream tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation requires a GUAIKEI_API_TOKEN and instructs users to run commands with search keywords, URLs, and identifiers, but it does not explicitly warn that these inputs are sent to a third-party service. This creates a transparency and privacy risk: users may unknowingly transmit research targets, competitive intelligence queries, and content identifiers outside their environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The function sends a token and user-supplied video URL to an external API via requestApi, which is a safety-relevant network operation involving potentially sensitive data. Although the code has developer docstrings, there is no visible user-facing warning, confirmation, or disclosure in this file that these values will be transmitted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This function performs a GET request that includes the token, URL, and limit in request parameters, which is a network operation involving user or system data. The file does not provide a user-facing warning, confirmation, or disclosure that these values are sent to a remote service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The CLI persists fetched comment data to a local JSON file after completing a read/query action, creating an undeclared secondary data sink. Even if the source data is public, comments can contain personal information, and silent retention increases privacy, data handling, and host-side exposure risks if logs are later accessed by other users or processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The tool writes complete comment results to a local file without explicit user notice or consent, which is a privacy and transparency issue. Persistent storage changes the risk profile from transient querying to local data collection, especially because comment text may include usernames, contact details, or other sensitive personal content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language strings shown to users throughout the file are all in Chinese, including status and error messages, and there is no indication that the skill offers language selection or that it is intentionally restricted to a Chinese-speaking context. Under SQP-3, a fixed language without opt-in or documented justification can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest describes a skill for searching and analyzing public Douyin data, which implies retrieval and analysis behavior. This file additionally persists the full task output to a local JSON file via log.taskWrite, which is a side effect not stated in the manifest and goes beyond purely read/analyze behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The authentication error string is written only in Chinese and provides no alternative language or indication that the skill is region-specific. This can violate a language/locale policy when users are not given a choice of language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing warning and informational strings are entirely in Chinese, and the file provides no indication that language selection is optional or region-specific. This can violate language/locale policy when users are not given an opt-in choice for a forced language.

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 user-facing natural-language fields such as title and description entirely in Chinese, which can effectively force a specific language for users or integrators. The file does not indicate that Chinese is optional, configurable, or justified as a region-specific requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The title and description are written only in Chinese, which can impose a specific language/locale on users or downstream tooling without opt-in. The file provides no indication that this schema is region-specific or intentionally limited to Chinese-speaking contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This manifest/schema uses only Chinese natural-language titles and descriptions, such as the title and property descriptions, with no indication that the skill is China-specific or that users can choose another language. Under the policy, forcing a specific language without opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This JSON schema contains user-facing title and description strings exclusively in Chinese, including field descriptions throughout the file. Because the file does not provide an alternative language option or document that the skill is intentionally limited to a Chinese-language context, it may violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.