Back to skill

Security audit

guaikei-douyin-recon

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for Douyin data collection, but it needs Review because it mishandles its API token, saves collected data locally by default, and contradicts its own promise not to show promotional contact information.

Review this skill before installing. It is not showing destructive behavior or hidden local takeover, but users should be comfortable with sending Douyin queries, URLs, and a GUAIKEI API token to www.guaikei.com, with results saved under the skill's logs directory by default. Tokens should be treated as potentially exposed because the code places them in request URLs; rotate any token used with this version if server or proxy logs may retain URLs.

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/request.js:50
Finding

Hardcoded Promotional Contact Information Is Injected into Runtime Error Output

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:50-55; propagated by src/douyin/search-cli.js:175-197 and equivalent error handlers in the other CLI modules
Vulnerability Type: Runtime output manipulation and declared-policy violation
Risk Level: Medium

Code Evidence

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

The CLI propagates this message directly into both diagnostic output and structured standard output:

js
} catch (error) {
  utils.printError(`搜索失败: ${error.message}`);
  const errorOutput = {
    status: "error",
    error_code: error.code || "UNKNOWN",
    message: error.message,
    timestamp: new Date().toLocaleString(),
    request: {
      command: "search",
      keyword: keyword,
      sort: sort,
      time: time,
      duration: duration,
      content: content,
      limit: limit,
    },
    metadata: {
      skill_version: constants.VERSION,
      runtime_version: process.versions.node,
      execution_time: Date.now() - startTime,
    },
    results: null,
  };
  const exitCode = error.name === "AuthError" ? 3 : 1;
  process.stdout.write(JSON.stringify(errorOutput, null, 2) + "\n", () =>
    process.exit(exitCode),
  );

Technical Analysis

The Skill documentation explicitly states that invalid-token errors must be neutral and must not contain contact details or marketing language. The implementation contradicts that policy by embedding a WeChat contact number in the authentication-error path.

Because error.message is copied without filtering into structured JSON on standard output, any agent consuming the CLI result receives the promotional contact information as if it were a legitimate operational error. The same message is also written to stand ...[truncated 1310 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the hardcoded message with a neutral error, such as GUAIKEI_API_TOKEN is invalid or expired.
  2. Do not include telephone numbers, social-media handles, URLs, sales instructions, or other promotional content in runtime errors.
  3. Map authentication failures to locally defined, fixed messages rather than exposing external-service messages directly.
  4. Sanitize all errors before placing them in Agent-consumable JSON output.
  5. Add regression tests that simulate HTTP 401 and 403 responses and verify that stdout and stderr contain no contact information or marketing language.
  6. Review all other CLI error handlers to ensure they follow the same neutral-output policy.

T09 · Insecure Skill Coding Practices

Warning
Location
src/api/search.js:59
Finding

API Token Is Exposed Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: src/api/search.js:59-62 and src/utils/request.js:104-112
Additional Locations: src/api/search.js:104-107, src/api/comment.js:38-40, src/api/comment.js:67-70, src/api/post.js:23-25, src/api/post.js:50-53, and src/api/hot.js:19-22
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: Medium

Code Evidence

The token is added to request parameters:

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

The request utility serializes all parameters, including the token, into the URL:

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 operations use the same unsafe construction:

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

return await request(options);

Technical Analysis

The API token is treated as a query parameter instead of an authentication credential. HTTPS protects the URL while it is in transit, but it does not prevent the full request target from being recorded after TLS termination.

URLs are routinely retained by reverse proxies, web-server access logs, API gateways, load balancers, observability platforms, tracing systems, debugging tools, and error reports. Consequently, a valid token may be copied into multiple systems with broader access and longer retention than intended.

This pattern affects search, comments, posts, and hot-list requests. Polling and retry behavior m ...[truncated 1230 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the token from every query-parameter object.
  2. Send it in an authentication header, preferably:
    js
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
      "Accept-Encoding": "identity",
    }
    
  3. Update the server to reject authentication credentials supplied through URLs.
  4. Redact authorization values and sensitive query keys from application, proxy, gateway, tracing, and diagnostic logs.
  5. Rotate existing tokens because they may already be present in historical logs.
  6. Apply short token lifetimes, revocation support, least-privilege scopes, and per-token rate limits.
  7. Add automated tests that inspect generated request paths and fail if token, secret, password, or equivalent credential fields appear in a URL.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (50)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码块的核心功能非常明确:接收抖音博主主页URL和数量限制,创建“已发布作品”任务,并查询返回作品数组。它访问的接口路径也是 /api/douyin/post/url 和 /api/douyin/post/info,表明资源对象是博主已发布视频作品,而不是舆情监测描述中的关键词搜索、评论抓取或热点榜单。虽然“查看博主作品”可能在某些场景下可辅助舆情分析,但这不是描述中声明的主要能力,且属于不同的数据获取方式。因此描述与代码行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

从代码看,唯一涉及的API是 /api/douyin/general-search/keyword 和 /api/douyin/general-search/info,对应创建抖音关键词搜索任务及查询结果。processSearchResults 只是对返回结果做展示友好的补充处理,没有评论抓取、热榜查询、跨源舆情聚合或品牌评价分析等实现。因此,描述中的一部分能力(按关键词搜抖音内容)是准确的,但整体描述把技能表述为可用于评论区抓取和热点榜单追踪,这与当前代码块实际行为不符,属于能力声明大于实现范围的描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

描述强调的是舆情监测场景下的三类核心能力:关键词搜内容、视频评论抓取、热点榜单追踪。但该代码块的主功能与这些能力并不一致。它解析 --url/--limit 参数,校验抖音用户主页 URL,随后调用 createPostTask/getPostTask 来获取“博主作品列表”,即围绕账号主页抓取作品,而不是关键词搜索、评论区抓取或热点榜单查询。虽然都属于抖音数据获取范畴,但资源对象和主用途明显不同:描述面向舆情检索与监测,代码面向指定博主作品枚举。因此属于实质性描述-行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

代码片段仅包含一个通用参数解析模块(parseArgs/readValueAfterFlag/buildHelp),其职责是处理命令行输入和生成帮助信息。这属于底层工具代码,本身不执行任何与声明描述相关的核心能力。根据给定代码,技能的实际行为与“抖音舆情监测”这一声明用途存在明显不一致,主功能完全不同。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是抖音舆情监测与数据抓取,但所给代码块仅是一个通用日志落盘模块,与搜索短视频内容、抓取评论、追踪榜单等主功能无关。虽然日志记录可能是辅助实现细节,但当前代码本身没有体现任何与声明目的直接相关的行为,反而表现出本地文件写入这一未声明的能力。因此该代码块与声明用途存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向抖音等短视频平台的舆情监测技能,核心能力应涉及网络平台内容检索、评论采集、热点追踪等。而提供的代码片段只是在本地文件系统中定位并读取 package.json,然后返回其中的 name 字段。这与声明的主要用途完全不一致。虽然这可能只是一个辅助工具文件,但就该代码片段本身来看,其实际行为与所述技能能力无关,因此应判定为明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

该代码片段与声明的高层用途明显不一致。声明描述的是一个完整的抖音舆情/口碑监测技能,但实际提供的代码只是验证层的辅助工具函数:一个将输入整理为抖音用户主页URL,另一个将数量参数限制在指定区间。这些可被视为某个抖音采集工具的配套实现,但从本片段本身看,既没有执行舆情监测核心动作,也没有访问评论、搜索结果或热点榜单资源。因此应判定为描述与所提供代码行为不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% 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. That creates a capability mismatch: the runtime may grant broader environment access than reviewers or orchestrators expect, reducing transparency and weakening least-privilege controls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill says it should activate even when the user does not mention Douyin, including broad requests like '网上对我们评价怎么样' and generic short-video research. Overly broad triggers can cause unintended invocation, resulting in unnecessary collection of third-party platform data or sending user queries into a tool the user did not explicitly request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The listed implicit trigger phrases are generic enough to match many unrelated research or trend-analysis requests. In an agent setting, this can cause overcollection, accidental platform-specific processing, and user-surprising behavior, especially because the skill can query external services and log results.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs automatic archival of logs to logs/ using filenames derived from timestamp, keyword, parameters, and type. This can persist sensitive user queries, monitored brand names, campaign terms, or investigation topics to local storage without any retention, minimization, consent, or sanitization controls.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest frames the skill as a Douyin public-opinion monitoring tool focused on keyword-based content search, specified video comments, and trend/hot-list tracking. This schema instead defines inputs for fetching a creator’s works from a homepage URL or SEC_UID, which is a different capability not described in the manifest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The README states that scraped Douyin data is automatically exported to local JSON logs, including comments and account/video-derived identifiers, but provides little prominent warning about retention, sensitivity, access controls, or downstream handling. In a recon/monitoring skill, this increases the chance that potentially sensitive scraped content is stored longer than intended, exposed to other local users/processes, or reused in ways that create privacy and compliance risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The changelog advertises capabilities beyond the declared skill scope, including user/social-data search and bulk retrieval of an author's published works. In a reconnaissance and public-opinion monitoring skill, this scope expansion materially increases privacy, profiling, and surveillance risk because an agent may invoke broader collection behavior than users expect or consent to.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented capability to fetch a Douyin creator's full post history expands the skill beyond the described scope of keyword search, comment retrieval, and hot-list tracking. This scope drift can enable broader profile surveillance and collection of creator activity data without clear user expectation or governance, which is risky in a recon/monitoring skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes capabilities for keyword-based Douyin content search, scraping comments for specified videos, and tracking hot rankings for public-opinion monitoring. This file instead creates tasks against a creator homepage URL to retrieve that creator's published posts, which is a distinct data-collection capability not mentioned in the manifest.

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 comment results to a local JSON file, which creates a secondary data store of potentially sensitive user-generated content outside the immediate read/monitoring flow. In a monitoring skill, this expands data retention and exposure risk: local files may be readable by other users/processes, accidentally committed, or retained longer than expected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Multiple user-visible strings in comments and runtime messages are exclusively in Chinese, such as the function description and status/error outputs. Under the locale policy rule, forcing a specific language without opt-in or documented regional 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
94% confidence
Finding

The manifest describes keyword-based content search, comment scraping for specified videos, and hot-list tracking to support舆情/口碑监测. This file instead implements '获取抖音博主作品列表' from a user profile URL/sec_uid, which is a distinct capability not described in the manifest, and writes the output to a local JSON log file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code persists the full output, including request details and fetched results, to disk via log.taskWrite. Although the file is a CLI tool for fetching posts, there is no visible confirmation prompt or user-facing disclosure here that results will also be saved locally, which can affect user data handling and privacy expectations.

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 the user's keyword and full search results to a local JSON file without explicit consent, warning, or retention controls. In a reputation-monitoring context, these queries and results can contain sensitive business intelligence, incident-response topics, or potentially personal data from comments/videos, creating avoidable local data exposure on shared machines, CI runners, or compromised endpoints.

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-visible error strings are written only in Chinese, including authentication guidance and failure messages. For a general utility module, this forces a specific language on users without opt-in or documented justification, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file contains user-facing strings and comments in Chinese, including validation errors and formatted output, but there is no indication that the skill is explicitly China/Chinese-locale only or that users can opt into this language. Per the policy, forcing a specific language without user 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
90% confidence
Finding

This JSON schema contains user-facing title and description fields entirely in Chinese, which effectively forces a specific language for consumers of the schema. The file does not provide an alternate locale, language selection, or documentation that this is intentionally 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
94% confidence
Finding

The schema title and description are written only in Chinese, which constitutes a language-specific constraint in natural-language metadata. The file does not indicate that this locale is optional, user-selectable, or justified as region-specific, so it may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.