Back to skill

Security audit

抖音作品爬取 抖音KOL作品爬取 抖音博主作品爬取

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to perform the advertised Douyin data collection, but it can collect large datasets and automatically saves scraped results locally.

Review before installing. Use it only for public Douyin data you are allowed to collect, protect and rotate the GUAIKEI_API_TOKEN if exposed, expect data to be sent to guaikei.com, and delete or restrict access to the generated logs because they may contain usernames, comments, profile links, and IP-region labels.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
src/douyin/comment-cli.js:151
Finding
Automatic Plaintext Retention of Collected Social-Media Data## Vulnerability Details **File Location**: `src/douyin/comment-cli.js:151-162`, `src/douyin/post-cli.js:152-162`, `src/douyin/search-cli.js:253-260`, and `src/utils/log.js:29-35` **Vulnerability Type**: Automatic plaintext storage of potentially sensitive user-generated data **Risk Level**: Medium ### Vulnerable Code `src/douyin/comment-cli.js:151-162`: ```js console.log(JSON.stringify(finalOutput, null, 2)); utils.printSuccess( `获取评论任务完成, 共返回 ${finalOutput.results.length} 条结果`, ); url = url.replace(/[^a-zA-Z0-9_-]/g, ""); url = url.replace("httpswwwdouyincomvideo", ""); url = url.replace("httpswwwdouyincomnote", ""); await log.taskWrite( `${startTime}_${url}_comment.json`, JSON.stringify(finalOutput, null, 2), ); ``` `src/utils/log.js:29-35`: ```js const outputFilename = path.join( path.dirname(__filename), "..", "..", "logs", safeFilename, ); try { await fs.promises.mkdir(path.dirname(outputFilename), { recursive: true }); await fs.promises.writeFile(outputFilename, content); ``` Equivalent automatic persistence occurs for post results in `src/douyin/post-cli.js:152-162` and search results in `src/douyin/search-cli.js:253-260`. ### Technical Analysis Successful search, post, and comment operations serialize the complete result object and automatically write it to a plaintext JSON file under the project-level `logs/` directory. This happens in addition to returning the result through standard output and does not require an explicit output option or separate user confirmation. The stored results may contain comment text, public account identifiers, profile URLs, author metadata, content metadata, and other fields returned by the external API. Because the supported result limit is up to 10,000 records, a single invocation can retain a substantial dataset. `fs.promises.writeFile()` and `fs.promises.mkdir()` are called without explicit restrictive modes. Effecti ...[truncated 1809 chars]
Remediation
## Remediation Suggestions 1. Remove automatic result persistence and return results only through standard output by default. 2. Introduce an explicit opt-in option such as `--output <path>` or `--save`, and clearly notify the user before writing data. 3. When persistence is enabled, create the log directory with mode `0700` and result files with mode `0600`, subject to platform support: ```js await fs.promises.mkdir(logDirectory, { recursive: true, mode: 0o700, }); await fs.promises.writeFile(outputFilename, content, { encoding: "utf8", mode: 0o600, flag: "wx", }); ``` 4. Add configurable retention and deletion controls, including automatic expiration of old files. 5. Minimize stored fields and avoid persisting account identifiers, profile URLs, or comment text unless necessary for the explicitly requested task. 6. Warn users before storing large datasets and document the storage location, contents, permissions, and retention behavior in `SKILL.md`. 7. Consider encryption at rest when persistent storage of collected records is required. 8. Add tests verifying that default execution creates no files and that opt-in files receive restrictive permissions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (47)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
存在明显描述与行为不一致。声明将技能定位为“抖音作品爬取工具”,核心表述是输入抖音URL或抖音ID后输出账号基础信息和近期作品列表,同时还列出搜索、热榜、作品抓取、评论分析四项能力。可是在提供的代码中,只看到一个专门用于“获取抖音热榜”的 CLI 入口:初始化 token,调用 hot.getHotTask(tokenValue),然后输出热榜结果。它没有处理抖音 URL、抖音 ID、sec_uid、aweme_id、关键词搜索、作品列表抓取或评论分析逻辑。从审计角度看,这不是额外危险能力的问题,而是声明的主要用途与该代码块实际功能范围明显不同。虽然声明中包含“实时热榜查询”这一子能力,因此代码并非完全无关,但若拿声明整体尤其是主描述“作品爬取工具”来对照,这个代码块只是其中一个热榜子命令,不能准确代表所宣称的主要功能。

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
从提供的代码看,src/utils/args.js 仅包含 readValueAfterFlag、parseArgs、buildHelp 等命令行参数处理函数,用于解析选项、检测重复参数、校验必填项、处理布尔值和生成帮助文案。这属于底层通用工具模块,不涉及网络请求、抖音接口调用、页面抓取、数据提取、评论分析或热榜查询。声明描述的是一个面向抖音内容抓取与分析的完整功能性技能,而实际代码片段只展示了无业务特定性的参数解析实现,二者主用途明显不一致。因此应判定为描述与代码行为不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
声明描述的是一个面向抖音的多功能爬取/分析技能,核心能力应涉及抖音链接/ID处理、网络请求、数据抓取与内容分析。但提供的代码片段只有一个工具函数 skillName():通过 fs 和 path 定位到 package.json,读取并解析 JSON,然后返回包名。该行为与抖音作品抓取、搜索、热榜、评论分析等能力均无直接关系。虽然这可能是技能内部的辅助模块,但就该代码片段本身而言,其实际行为与声明用途明显不一致,因此应判定为 mismatch。

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
从提供的代码看,这只是一个 `token.js` 工具模块,核心功能是校验 `GUAIKEI_API_TOKEN` 是否符合长度和字符规则,并在无效时打印推广性质的信息(网站和微信联系方式),有效时返回 token。该代码片段没有任何与抖音 URL/ID 解析、账号信息获取、作品列表拉取、关键词搜索、热榜查询或评论分析相关的实现。虽然令牌管理可能是大型技能的辅助部分,但就此代码片段本身而言,其实际行为与声明的主要用途明显不一致,因此应判定为描述与行为不匹配。

Credential Access

High
Category
Privilege Escalation
Content
- 技能重命名为“douyin-search-keyword”。
- 在SKILL.md中添加了openclaw元数据、使用帮助、许可证、标签和示例,以实现更好的集成与文档化。
- 移除了两个本地文件(.env 和 scripts/last-search.json),以优化代码结构并提升安全性。
- 文档现已更加简洁且以用户为中心,重点在于提供清晰的使用说明和数据字段解释。
- 突出技能特性、合规要点及技术流程。
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding
The skill declares access to a sensitive environment variable (`GUAIKEI_API_TOKEN`) but does not define an explicit tool scope such as `permissions` or `allowed-tools`. In an agent setting, missing scope boundaries can let the runtime expose more capability than intended, making secret access and command execution less auditable and increasing the chance of accidental misuse.

Natural-Language Policy Violations

Medium
Confidence
77% confidence
Finding
The natural-language trigger examples and operational guidance are written as if the skill is to be invoked and used in Chinese only, with no indication that other languages are supported or that the user may choose their preferred language. This can violate language/locale policy when a skill effectively imposes a language without user opt-in.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The description embeds very broad trigger phrases such as '查看抖音视频' and '抖音内容采集', which can match many ordinary user requests and cause the skill to activate outside narrowly intended contexts. Because this skill performs large-scale scraping and data collection, overbroad invocation increases the chance of unintended execution, unnecessary external data access, and privacy/compliance risk.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The README explicitly says the tool auto-exports JSON logs containing scraped videos, account data, and comments to a local logs folder, but it does not prominently warn that potentially sensitive or regulated platform data will be retained on disk. This increases risk of unintended local exposure, over-retention, sharing through backups/version control, or collection of personal data from comments without informed handling.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The instructions require users to obtain and set a private API token in an environment variable, but the credential-handling guidance is minimal and not presented upfront as a security precaution. Users may expose the token through shell history, screenshots, shared terminals, CI logs, or accidental publication, leading to unauthorized API use and account abuse.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The changelog title is entirely in Chinese, and the file provides no indication that language choice is optional or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
This documentation explicitly enables large-scale Douyin scraping, account content harvesting, hot-topic collection, and comment retrieval up to 10,000 items, but provides no warning about privacy, platform Terms of Service, legal restrictions, or account/IP blocking risk. In the context of an agent skill, that omission increases the chance of misuse for mass surveillance, profiling, or abusive data collection, especially because the skill is purpose-built for harvesting public user-generated content at scale.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The natural-language strings in the file, including the module description and function documentation, are exclusively in Chinese. Under the policy, forcing a specific language without offering user choice or clearly documenting a justified locale constraint is a violation.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The CLI persists the full crawl output to a local JSON file after printing results, but this storage behavior is not obvious from the command interface and may include sensitive or regulated data such as account metadata, content lists, and comments. In a scraping skill, silent local retention increases privacy, compliance, and data exposure risk if the host filesystem is shared, backed up, or later exfiltrated.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The CLI writes the full search output to a local log file whose name includes the user keyword, creating persistent storage of potentially sensitive query terms and collected content without clear user consent or retention controls. This increases the risk of local data leakage through shared systems, backups, or later unintended access.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
Natural-language strings in comments, errors, and help output consistently force Chinese for user-facing interaction. The policy only permits a fixed language when the skill offers opt-in or clearly documents a justified locale restriction, neither of which is present here.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This code constructs and sends outbound HTTPS requests that include request parameters, JSON body data, and a TOKEN header. While the file has internal API doc comments and retry logging, it does not include any user-facing disclosure, confirmation, or warning in this file about transmitting user/system data or credentials over the network.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The module emits all user-facing status and warning text only in Chinese, including operational guidance and recovery instructions. This imposes a specific language on users without any opt-in or alternative, which matches the language/locale policy violation criteria.

Vague Triggers

Low
Confidence
89% confidence
Finding
This manifest-type JSON file describes the skill only as obtaining Douyin work comments from command-line parameters, but it does not define any explicit activation phrases, scope boundaries, or exclusion conditions. In a manifest/context where descriptions may be used for routing, this broad description could contribute to ambiguous invocation for general comment-fetching requests.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
This JSON schema contains user-facing natural-language strings such as the title and field descriptions exclusively in Chinese. Under the policy rule for natural-language violations, forcing a specific language without user opt-in or documented justification is a locale policy issue.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
This JSON schema uses Chinese-only natural-language metadata in the title and description fields throughout the file. Because the file does not indicate that the skill is region-specific or that users can opt into this locale, it may violate the language/locale policy requiring choice or justification.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
This JSON schema contains human-facing title and description fields exclusively in Chinese, which can impose a specific language on users without opt-in. Under the policy, locale or language constraints should either offer user choice or be clearly documented as intentionally region-specific.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
This JSON schema uses only Chinese natural-language title and description text, and the file does not document that the skill is China-specific or that language choice is optional. Under the policy rule for language/locale constraints, this can be a natural-language policy issue because it implicitly fixes one language without user opt-in or justification.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
This JSON schema uses only Chinese natural-language titles and descriptions for the skill inputs, with no indication that the skill is region-specific or that users can opt into that locale. Under the policy, forcing a specific language without user choice or documented justification is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The schema title and all field descriptions are written in Chinese, which imposes a specific language on users of this skill metadata. The file does not indicate that the skill is region-specific or provide any user language choice, which fits the natural-language locale policy violation criteria.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:16