T09 · Insecure Skill Coding Practices
- Location
src/utils/request.js:79- Finding
API credential transmitted in URL query strings
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a purpose-aligned Xiaohongshu public-data retrieval tool, with manageable privacy and credential-handling risks users should understand.
Install only if you are comfortable sending Xiaohongshu keywords, URLs, limits, and your GUAIKEI_API_TOKEN to Guaikei for processing. Use it only for public/authorized data, protect and rotate the token as needed, and review or delete the generated logs because they may contain comments, profile data, request details, and xsec_token-bearing links.
src/utils/request.js:79API credential transmitted in URL query strings
src/utils/log.js:5Complete API results are automatically persisted in plaintext
声明描述的是一个面向小红书的数据采集技能,核心能力应包括访问小红书相关资源并获取结构化内容数据。但提供的代码片段只包含通用参数解析函数 parseArgs、readValueAfterFlag 和 buildHelp,没有任何网络请求、平台接口调用、数据抓取、解析小红书内容或结构化输出逻辑。因此该代码的实际行为与声明的主要用途存在明显不一致。这不是单纯的支持性实现细节,因为当前片段本身的功能完全是 CLI 工具层,而非所声明的采集能力。
声明的核心用途是从小红书采集公开内容数据,但给出的代码片段实际只使用 fs 和 path 在本地读取 package.json 并返回 name 字段。这与声明的主要功能完全不一致。虽然这可能只是辅助代码片段,但就该片段本身而言,它展现的是本地文件访问和元数据读取能力,而不是小红书内容抓取。根据评估标准,应判定描述与实际行为不匹配。
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"
Referenced artifact was not completely inspected
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"
Referenced artifact was not completely inspected
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"
Referenced artifact was not completely inspected
- "看这篇爆款笔记的详情和互动数据: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy'"
Referenced artifact was not completely inspected
- "看这篇爆款笔记的详情和互动数据: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy'"
Referenced artifact was not completely inspected
- "看这篇爆款笔记的详情和互动数据: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy'"
The skill declares access to an environment secret (GUAIKEI_API_TOKEN) but does not define an explicit tool scope or permission boundary. That weakens least-privilege guarantees and makes it harder to audit what the skill may access at runtime, especially in agent platforms where undeclared capabilities can still be reachable through wrappers or future code changes.
The skill says it should be used even when the user did not explicitly ask to 'collect' or 'scrape' data, as long as the task involves obtaining Xiaohongshu content. This broad trigger increases the chance of silent third-party data transmission and unexpected scraping actions without sufficiently informed user intent, which is risky for privacy, consent, and policy compliance.
The skill routes user-provided Xiaohongshu links and search terms through a third-party API, but the main usage sections do not prominently warn users before collection begins. Because links may contain identifiers or tracking/query parameters and searches may reveal sensitive business intent, lack of up-front disclosure can lead to unintended data sharing with an external service.
The README states that all task results are automatically saved to the logs/ directory, but it does not warn users that those results may include sensitive operational data such as searched keywords, profile or note URLs with tokens, comment content, and analysis outputs. In this skill’s context, the tool is explicitly used for scraping and evaluating third-party social media data at scale, so unattended local retention increases the risk of accidental disclosure, over-collection, or insecure sharing of scraped datasets.
The file title and all invocation guidance are written exclusively in Chinese, and the natural-language trigger examples assume Chinese user phrasing. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the constraint is explicitly documented and justified, which is not present here.
The natural-language content in the module header, function descriptions, and error messages is exclusively in Chinese, which can constitute a language policy violation when no user opt-in or locale constraint is documented. The file does not indicate that the skill is intended only for Chinese-speaking users or a China-specific compliance context.
This file uses Chinese-only natural language in module documentation and parameter descriptions, and later emits Chinese-only error/retry messages. Under the policy rule, forcing a specific language without user opt-in or a clearly documented region-specific justification is a natural-language policy violation.
The thrown error and retry log strings are hardcoded in Chinese, which enforces a single language for operational output. The file does not indicate that users can choose locale or that the skill is explicitly limited to Chinese-speaking users.
The user-facing strings at L22-L25 are entirely in Chinese and there is no indication that the skill is region-specific or that users can opt into another language. This is a natural-language policy concern because the skill imposes a specific language for warnings and instructions without user choice.
Multiple error strings are presented only in Chinese, including credential and request-failure messages, with no indication that users can select another language. This imposes a specific language on users without opt-in, which matches the locale/language policy violation criteria.
The error message explicitly references the GUAIKEI_API_TOKEN environment variable, indicating this request flow depends on credentials from the environment, yet the file provides no user-facing disclosure or documentation warning about credential usage. Access to sensitive environment variables or credentials is in scope for missing-warning findings in code files.
This code sends caller-provided params and data over HTTPS via both GET query strings and POST JSON bodies, but the file contains no confirmation prompt, logging, comment, or docstring disclosing that user or system data may be transmitted to a remote service. Because network transmission is safety-relevant for code files under this rule, the lack of any visible disclosure is a quality/safety gap.
This JavaScript file contains natural-language comments and error messages exclusively in Chinese, such as the validation messages printed to users. Under the stated policy, forcing a specific language without user opt-in or clear justification is a natural-language policy violation.
This code persists the full command output, including the requested note URL and retrieved comment data, to a JSON file via log.taskWrite. While the tool prints status messages, there is no user-facing disclosure here that results will be saved to disk, which is a file-write operation with potential privacy impact.
Detected: suspicious.exposed_secret_literal