T09 · Insecure Skill Coding Practices
- Location
src/utils/request.js:78- Finding
API Token Exposed Through URL Query Parameters
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Douyin data skill is mostly coherent, but it should be reviewed because it handles an API token unsafely and automatically stores bulk social-media results locally.
Install only if you are comfortable sending Douyin query/link inputs and your GUAIKEI_API_TOKEN to guaikei.com, and treat generated logs as stored social-media datasets that may contain personal information. Prefer a token with limited quota, rotate it if exposed, keep logs private, and delete exports you no longer need.
src/utils/request.js:78API Token Exposed Through URL Query Parameters
src/utils/request.js:25Out-of-Scope Error Variable Causes Unhandled API Error Failure
src/utils/request.js:19Unbounded HTTP Response Buffering Permits Memory Exhaustion
代码片段仅实现了通用参数解析与帮助信息构建:读取 flag 值、校验重复参数/未知参数/必填参数、处理布尔参数和位置参数,并生成 CLI 帮助文本。这与声明的“抖音公开数据智能获取工具”主目的明显不一致。代码中没有任何与抖音相关的 API 调用、网页抓取、评论分析、热榜查询、博主作品抓取或数据分析逻辑。虽然该代码可能作为某个更大工具的底层辅助模块存在,但就当前提供的代码片段而言,其实际行为是通用 CLI 支撑功能,而非声明的抖音数据能力,因此应判定为描述与行为不匹配。
声明描述聚焦于抖音数据抓取、搜索、评论分析和热榜查询等业务能力;而实际代码仅执行本地日志文件写入,与抖音数据获取或分析功能没有直接对应关系。虽然日志记录可能是辅助实现细节,但从该独立代码片段本身看,其行为是文件系统写入,这一能力未在声明中体现,且其主要目的与声明的核心功能明显不一致。因此应判定为描述与行为不匹配。
The declared description presents a user-facing Douyin data collection and analysis tool. However, the supplied code chunk merely implements a helper that synchronously reads ../../package.json from the local filesystem and returns pkg.name. This behavior does not demonstrate any of the declared Douyin-related capabilities such as querying public data, scraping creator works, analyzing comments, or fetching hot rankings. While utility code can support a larger skill, this chunk’s actual behavior is unrelated to the stated primary purpose, so it should be flagged as a mismatch for this code chunk.
声明的核心能力是抖音公开数据获取与分析,但提供的代码片段实际上只处理私有TOKEN的格式验证和配置检查,并在无效时显示带有营销性质的提示信息。这与抖音搜索、热榜、评论、作品抓取等能力没有直接对应关系。虽然TOKEN管理可被视为某些技能的辅助实现,但当前代码片段的实际行为与声明用途差距过大,且包含未在描述中体现的授权/推广行为,因此应判定为描述与行为不匹配。
The skill requires access to an environment secret (GUAIKEI_API_TOKEN) but does not declare any explicit tool scope or permission boundaries. That makes the trust boundary unclear for a third-party skill and can allow broader-than-expected secret exposure or execution authority in hosts that rely on manifest scoping for enforcement.
This manifest-style JSON file contains user-facing natural-language fields such as title and description entirely in Chinese. Because the file does not document that the skill is intended only for Chinese-speaking users or offer any language choice, it imposes a specific language without user opt-in.
This JSON schema is a manifest/config-type file, so SQP-3 applies. The title and descriptions consistently force a specific language/locale (Chinese) and the file does not indicate that the skill is region-specific or that users can choose another language, which can violate language/locale policy requirements.
The README explicitly promotes exporting large volumes of public Douyin video, author, and comment data to JSON logs, but provides no meaningful guidance on privacy, retention, minimization, or safe handling of potentially sensitive personal data contained in comments and profiles. Even if the data is publicly accessible, bulk collection and persistent local storage materially increase privacy and compliance risk, especially for comment content that may include personal information.
The changelog and feature descriptions are primarily written in Chinese, which can impose a language requirement on users without any indication of opt-in or alternative locale support. Under the language/locale policy, this is a natural-language policy concern unless the file clearly documents that the skill is intentionally region-specific or offers a language choice.
The file documents how to collect Douyin creator posts and comment data at scale, including large limits, but provides no privacy, consent, retention, or lawful-use guidance. In a scraping/analytics skill, that omission increases the risk of misuse for profiling, monitoring, or bulk collection of user-generated data, even if the data is nominally public.
The stated purpose emphasizes obtaining public Douyin data, which suggests access to public endpoints or transparent service use. This implementation requires a secret token from GUAIKEI_API_TOKEN, adding an authentication capability not described in the manifest and not obviously necessary from the user's perspective.
The tool writes fetched comment data to a local JSON file without clear disclosure or user consent in this flow. Persisting scraped social-media data increases privacy and data-retention risk, especially on shared hosts or agent environments where local artifacts may be accessible beyond the immediate run.
Comment results are saved locally without explicit warning in this file, creating silent data persistence. In agent or multi-user environments, this can expose collected content to unintended readers, complicate compliance, and leave residual artifacts after task completion.
This code includes user-facing descriptions and status/error messages entirely in Chinese, such as the main function description and printed success/error outputs. Under the policy rule, forcing a specific language without user opt-in is a natural-language locale violation unless the regional constraint is clearly documented and justified, which is not evident in this file.
The manifest frames the skill as an intelligent tool for fetching public Douyin data, which does not by itself imply access to external credentials. This code requires GUAIKEI_API_TOKEN from the environment, meaning the skill depends on authenticated access to another service, a capability not disclosed in the stated purpose.
post.createPostTask and post.getPostTask are network-oriented API calls and send user-supplied input plus an authentication token to an external service. The file contains success/error messages, but no explicit warning in the help text or nearby comments that running the command sends data off-host.
The manifest describes this skill as a tool for obtaining and analyzing public Douyin data such as author works, comments, and hot rankings. This file additionally persists the full results to disk via log.taskWrite, which is a behavior beyond the described retrieval/analysis interface and introduces local data storage not mentioned in the skill description.
This code persists the full command output, including the requested URL and retrieved results, to disk via log.taskWrite. Although the file prints status messages, there is no clear user-facing disclosure here that data will be saved locally, which matters because file writes are a safety-relevant operation under the rule.
The main docstring describes argument parsing, executing a search task, outputting results, and saving logs, which suggests a local orchestration flow. However, the implementation explicitly calls search.createSearchTask(...) before fetching results, meaning it triggers creation of a remote task as a side effect not reflected in the documentation.
The manifest emphasizes retrieval of Douyin public data such as search, hot lists, comments, and author works. In this file, the command requires reading process.env.GUAIKEI_API_TOKEN, introducing credential handling that is not justified or disclosed by the stated end-user purpose of public-data querying.
The CLI persists full search output to a local JSON file, including retrieved content and request metadata, without any explicit notice or opt-in. Even if the source data is public, saved query terms and aggregated results can reveal user interests, investigations, or monitoring activity, and the local file may be accessible to other users or later exfiltrated.
The code emits user-facing error messages in Chinese only, such as the filename and content validation errors. This imposes a specific language on users without opt-in or any documented justification, which matches the locale-policy violation criteria.
The authentication failure message embeds a personal WeChat/phone contact unrelated to normal API error handling. Hard-coded out-of-band contact data can socially engineer operators into contacting an unverified individual, leaks personal information into logs/UI, and is especially suspicious in a networked skill that depends on external authentication.
This code performs outbound HTTPS requests in both POST and GET flows, including URL parameters and JSON request bodies, but provides no confirmation prompt or user-facing disclosure at the point of transmission. The existing docstring and retry error logging describe mechanics of the API call, but they do not warn users that supplied data will be sent over the network.
The user-facing strings emitted by this code are entirely in Chinese, including warnings and status messages, with no indication that the skill is China-specific or that users can opt into another language. That creates a natural-language locale policy issue because the skill effectively forces a specific language on users without choice or justification.