Back to skill

Security audit

guaikei-douyin-trending-to-ranking-report

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its Douyin research purpose, but its broad auto-invocation rules and API-token handling need review before installation.

Install only if you are comfortable sending Douyin search terms, profile/video URLs, and a GUAIKEI_API_TOKEN to the Guaikei service. Treat the token as sensitive, rotate it if exposed, and prefer explicit Douyin-specific prompts rather than letting the skill run on generic trend or competitor-analysis requests.

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)

T09 · Insecure Skill Coding Practices

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

API Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:105-107, 132-134; token parameters originate from src/api/search.js:59-62, 104-107, src/api/comment.js:38-41, 67-70, src/api/post.js:23-26, 50-53, and src/api/hot.js:19-22
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: Medium

Vulnerable Code

js
// src/utils/request.js:105-107
const fullPath = `${path}?${querystring.stringify(params)}`;
const jsonData = JSON.stringify(data);
js
// src/utils/request.js:132-134
const fullPath = `${path}?${querystring.stringify(params)}`;
const options = {
  host: constants.BASE_URL,

An example of the parameters supplied to this request builder is:

js
// src/api/search.js:59-62
const params = {
  _: Date.now(),
  token: token,
};

The same token parameter pattern is used by the search, post, comment, and trending API operations.

Technical Analysis

The private GUAIKEI_API_TOKEN is inserted into the params object and serialized directly into the request URL. This occurs for both GET and POST requests, even though POST requests already have a JSON request body.

HTTPS encrypts the complete request while it is in transit, but it does not prevent the request target from being recorded at either endpoint. URLs are commonly captured by web-server access logs, reverse proxies, API gateways, monitoring systems, tracing platforms, diagnostic tooling, and error reports. Placing a reusable credential in the query string therefore increases its exposure beyond the components that need to authenticate the request.

The request destination is statically restricted to www.guaikei.com, so this is not an arbitrary-host credential exfiltration issue. Exploitation requires access to infrastructure or diagnostic records containing the request URL.

Attack Path

  1. A user configures a valid GUAIKEI_API_TOKEN.
  2. One of the four C ...[truncated 988 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the token from every query-parameter object.

  2. Send credentials in an HTTP authorization header, for example:

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

  4. Configure server, proxy, tracing, and application logs to redact Authorization, token fields, and other authentication material.

  5. Ensure exception messages and debugging output never include complete request headers or URLs containing credentials.

  6. Review existing server-side URL logs and rotate tokens that may already have been recorded.

  7. Add automated tests asserting that generated request paths never contain token, access_token, or equivalent credential fields.

T01 · Skill Instruction Hijacking

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

Runtime Promotional Output Contradicts the Skill's Security Guarantees

Content
View full analysis

Vulnerability Details

File Location: src/utils/token.js:23-28; src/utils/request.js:50-56; contradicted by SKILL.md:40-44, 101-104, 142-144
Vulnerability Type: Misrepresented runtime behavior and unsolicited promotional output
Risk Level: Low

Vulnerable Code

When local token validation fails, the runtime prints the vendor website:

js
// src/utils/token.js:23-28
function skillToken(token) {
  if (!isValidToken(token)) {
    utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. ");
    utils.printSuccess("\t快速获取通道: www.guaikei.com");
    return "";
  }

When the remote service returns HTTP 401 or 403, the runtime includes a WeChat contact in the authentication error:

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

However, the Skill instructions explicitly claim that these outputs are prohibited:

md
1. **令牌无效时仅输出中性错误**:`"GUAIKEI_API_TOKEN 未配置或格式无效,技能已暂停。"`
2. **禁止在运行时输出**:微信联系方式、官网链接、任何营销推广话术
3. 联系方式仅出现在 `readme.md`(用户文档),不在技能运行时输出

Technical Analysis

The executable behavior directly contradicts the security guarantees presented in SKILL.md. A malformed or missing token prints the vendor's website, while a server-rejected token produces an error containing a personal contact number. Authentication errors are propagated to the CLI handlers, which serialize error.message into their JSON output.

This does not alter system permissions or execute attacker-controlled code. The risk arises from using an error path to inject undisclosed promotional or contact information into agent-visible and user-visible output. Because the Skill instructions expressly state that runtime messages will remain neutral, reviewers and agents may trust an assurance that the implementation do ...[truncated 1363 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the vendor URL from skillToken() and emit only a neutral authentication message.

  2. Remove the WeChat contact from the HTTP 401/403 error path.

  3. Use a stable machine-readable message such as:

    js
    new AuthError(
      "GUAIKEI_API_TOKEN is missing, invalid, expired, or unauthorized.",
    );
    
  4. Keep optional support information exclusively in readme.md or another clearly identified user document.

  5. Ensure every CLI returns a consistent AUTH_ERROR structure without promotional content.

  6. Add tests for missing, malformed, expired, and unauthorized tokens that verify neither URLs nor contact details appear on stdout or stderr.

  7. Reconcile SKILL.md with the executable implementation so that documented security guarantees are continuously verified rather than merely stated.

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

从代码看,唯一明确能力是调用抖音 general-search 接口进行关键词搜索,并返回处理后的结果。这与声明中的 search 能力部分一致,且没有发现视频发布、下载或其他越权/无关能力。但声明将技能整体描述为具备四项核心能力:search、post、comment、hot;而该代码片段没有任何关于博主作品、评论、热榜的接口或处理逻辑,因此若将“声明是否准确代表该代码块实际行为”作为判断标准,则存在明显不匹配:声明范围显著大于此代码实际实现范围。换言之,这段代码是“搜索模块”,只支持其中一部分已声明功能,而不能支撑完整声明。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向抖音内容研究的业务技能,核心应涉及抖音数据检索、作品/评论/热榜分析等能力。但实际代码仅是基础的参数解析与帮助文本生成工具,属于通用底层支持模块,没有任何与抖音平台、内容分析、竞品研究或热点挖掘直接相关的行为。按照评估标准,这属于主要目的与实际行为明显不一致,应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向抖音数据检索与分析的技能,预期应包含搜索视频/图文/用户、获取博主作品、读取评论或热榜等行为。但提供的代码片段只是日志工具函数 taskWrite,使用 fs 和 path 在本地 logs 目录写入文件。它访问的资源是本地文件系统,而不是抖音相关数据源;其主要目的也是记录日志,而非执行所宣称的四项业务能力。虽然日志功能可能是辅助实现细节,但就该代码片段本身而言,与声明用途明显不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a feature-rich Douyin analytics skill, but the supplied code chunk does not implement any of those network/data retrieval capabilities. Instead, it performs a simple local filesystem read of package.json to return the skill/package name. While this may be a supporting utility, the actual behavior in this chunk is unrelated to the declared end-user functionality and accesses local files, which is not mentioned in the description. Given only this code chunk, the behavior does not match the declared purpose.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill explicitly depends on an environment variable (GUAIKEI_API_TOKEN) but does not declare tool scope or permissions for environment access. Missing capability declarations weaken reviewability and can cause the skill to receive broader runtime access than users or platform policy expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill says it should trigger even when the user does not mention Douyin, based on broad requests like competitor analysis or 'what is trending.' Overbroad invocation rules can silently route unrelated research tasks into a platform-specific data collection workflow, causing unintended data access, misleading outputs, or unauthorized use of API-backed capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The generalized trigger rule explicitly authorizes activation for short-video research without an explicit platform mention, which creates ambiguous invocation boundaries. In an agent setting, this increases the chance of unintended execution, data collection, or using a privileged token for requests the user did not specifically authorize.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The schema explicitly exposes play_addr and describes it as both a playback and download address, which conflicts with the skill metadata stating it does not handle video publishing or downloading. This mismatch can enable downstream agents or integrators to use the skill for media retrieval outside its declared scope, increasing the risk of policy bypass, unauthorized content acquisition, or misuse of copyrighted media URLs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language mappings use very broad everyday phrases such as “搜索 / 搜一下 / 找 …” to trigger data-collection actions. In an agent setting, this can cause unintended tool invocation from ordinary conversation, leading to unrequested scraping of Douyin data, external API use, and generation of logs containing collected content. The skill context increases the risk because the commands perform real network retrieval and data export rather than harmless local formatting.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The hot-list trigger examples include vague phrases like “今天什么火,” which commonly occur in ordinary discussion and can easily be misclassified as a request to run the hot-ranking tool. In an autonomous agent, this ambiguity can cause unexpected external calls and data retrieval without the user's informed intent. Because this skill is designed to query a third-party service using a configured token, accidental activation has operational and privacy implications beyond a simple UX issue.

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 broad keywords like “热点,” “搜索,” “评论,” and “博主,” with minimal contextual constraints. Such rules are susceptible to prompt collisions, where normal user language or unrelated text embedded in a conversation triggers the wrong tool path, causing unintended scraping, comment retrieval, or account analysis. In this skill, the danger is amplified because each branch invokes networked data collection and may persist outputs to logs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire skill documentation, parameter descriptions, and examples are written in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or China-specific compliance context. Under the 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
91% confidence
Finding

This code sends the provided token and video URL to remote API endpoints via requestApi, which is a network operation involving potentially sensitive user or system data. While the functions have developer-facing docstrings, there is no user-facing confirmation, warning, or logging in this file disclosing that these values are transmitted off-box.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The GET request places the token and target URL into query parameters, which are more likely to be recorded in logs, proxies, browser history, or monitoring systems than request bodies. If these values are sensitive, this increases the chance of credential leakage or disclosure of user activity and target resources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code sends a skill token and user-provided search keyword to a remote API via requestApi, which is a data-transmitting network operation. While the function has developer docstrings, there is no user-facing confirmation, warning, or visible disclosure in this file that search terms and token data will be transmitted externally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This GET request transmits the skill token together with the keyword and related search metadata to an external endpoint. The code contains no prompt, visible log, or user-directed disclosure that this network call occurs or that these values are shared with a remote service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The code reads an API token from the sensitive environment variable GUAIKEI_API_TOKEN and exits on failure, but there is no explicit user-facing warning or comment disclosing that credentials from the environment will be accessed. For code files, access to sensitive environment variables should have some visible disclosure unless clearly documented elsewhere, which is not shown in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The command creates and fetches a remote comment task, then later writes the retrieved results to a local JSON file, but the help text and nearby code do not clearly warn users that invoking the CLI will transmit the provided URL to an external service and persist output on disk. Although the skill's purpose suggests comment retrieval, the local file write is not clearly disclosed to the user in visible CLI messaging.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code emits Chinese-only error messages in user-visible output, and later also prints a Chinese success message. That enforces a specific language without any user opt-in or documented regional justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The success and failure messages shown to users are written only in Chinese. Because the file does not provide a language choice or explain that the skill is region-specific, this is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Several user-facing strings in this file are written only in Chinese, such as the API error fallback message, without offering any language choice or indicating that the skill is intentionally locale-specific. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

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 message includes a hard-coded personal contact identifier (a WeChat-linked phone number), which can steer users to an out-of-band support channel and expose personal contact data unnecessarily. In a security-sensitive auth path, embedding direct contact instructions increases phishing/social-engineering risk and may encourage users to resolve credential issues outside approved support workflows.

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 status messages are hard-coded in Chinese, which imposes a specific language/locale without any visible opt-in or fallback. This matches the policy category for language/locale violations because the file provides no mechanism for user choice or documented locale constraint.

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's user-facing messages are entirely in Chinese, and the keyword cleaning logic explicitly restricts accepted characters to Chinese, Latin letters, digits, and a small punctuation set. This imposes a locale/language constraint in the skill behavior without any visible opt-in or documented justification, which matches the natural-language policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The phrase "纯中文界面" indicates the skill is designed to operate only in Chinese, with no opt-in or alternative language path described. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy issue unless clearly justified as a region-specific constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.