T09 · Insecure Skill Coding Practices
- Location
src/utils/request.js:76- Finding
API Token Transmitted in URL Query Parameters
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its stated Xiaohongshu data-lookup purpose, but it handles credentials and saved result files in ways users should review before installing.
Install only if you are comfortable sending Xiaohongshu keywords, note/profile URLs, and your GUAIKEI API token to guaikei.com. Treat the token as sensitive, rotate it if exposed, and review or clean the local logs directory after use because fetched results are saved automatically.
src/utils/request.js:76API Token Transmitted in URL Query Parameters
src/utils/log.js:24Successful API Results Are Automatically Persisted Without Explicit User Consent
从代码看,createPostTask 调用 /api/xiaohongshu/post/url 创建基于博主URL的已发布笔记任务,getPostTask 调用 /api/xiaohongshu/post/info 查询该任务结果,参数也仅包含 token、url、limit。因此该代码块实际覆盖的能力是“抓取某博主公开作品列表”。而声明还包含关键词搜索、笔记详情、评论获取等多个功能,但在此代码块中均未体现。虽然代码行为属于声明的一部分,没有发现登录或发布等越权行为,但就‘描述是否准确代表该代码块实际做什么’而言,声明明显比实际代码宽泛,存在实质性描述—行为不一致。
代码行为与声明存在范围不一致。当前代码只围绕关键词搜索:调用 /api/xiaohongshu/note-search/keyword 创建搜索任务,调用 /api/xiaohongshu/note-search/info 获取搜索结果,并为笔记和用户拼接URL。这与声明中的“按关键词搜索小红书笔记”部分一致,也未发现登录或内容发布等越权能力。但声明还包含笔记详情、评论数据、博主作品列表等能力,而这些在该代码片段中没有体现。按给定标准,若代码主能力与声明相比存在实质性不同或范围不符,应判为不匹配。这里更准确地说是声明覆盖范围明显大于该代码实际实现范围,因此应标记为 mismatch。
代码片段仅实现了通用的命令行参数解析器(parseArgs/readValueAfterFlag/buildHelp),用于处理 flags、位置参数、默认值、重复参数检查、必填校验和帮助信息输出。它没有体现任何与小红书相关的搜索、笔记详情抓取、评论获取、博主作品抓取、结构化数据返回等核心能力。虽然这类工具代码可能作为整体技能的辅助模块存在,但就该代码片段本身而言,其实际行为与声明的主要用途明显不一致,因此应判定为描述与行为不匹配。
声明描述的是面向小红书内容检索/抓取的数据获取能力,而实际代码片段并未体现任何搜索、抓取、笔记详情、评论获取或博主作品列表采集逻辑。相反,它执行的是本地日志文件写入这一完全不同的功能。虽然日志记录可能是辅助实现细节,但就该代码片段本身而言,其行为与声明的核心能力没有直接对应关系,并且涉及未声明的本地文件系统写入能力。因此应判定为描述与代码行为不匹配。
The declared description presents a skill for structured Xiaohongshu content retrieval and analytics support. However, the supplied code chunk does not implement any network access, search, scraping, note retrieval, comment retrieval, or creator works listing. It merely reads a local package.json from disk and returns the package name. This is a materially different primary purpose and accesses a different resource class (local filesystem metadata rather than Xiaohongshu content), so the description does not accurately represent this code chunk.
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"
Referenced artifact was not completely inspected
- "分析这条小红书笔记评论区的主要观点: node src/xiaohongshu/detail-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
- "看这个小红书博主最近 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/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
- "只拉这条笔记的评论数据做观点归纳: 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"
The skill declares access to a sensitive environment variable (GUAIKEI_API_TOKEN) but does not define an explicit tool/permission scope such as permissions or allowed-tools. In an agent setting, missing scope boundaries can lead to broader-than-necessary execution privileges and make it harder to enforce least privilege or review what the skill is allowed to access.
The manifest description is written as an unconditional Chinese-language invocation/behavior description, and the file consistently presents the skill as operating only in Chinese without any user opt-in or alternative locale. Under the policy, forcing a specific language or locale without user choice is a natural-language policy violation unless clearly justified as region-specific.
The README states that all task results are automatically saved to the logs/ directory, but it does not clearly warn users that scraped note details, comments, keywords, profile URLs, or other potentially sensitive business data will be persisted locally. In a data-collection skill, silent persistence increases the risk of unintended retention, disclosure, or later exfiltration of collected data, especially on shared machines or when logs are backed up or committed inadvertently.
Manifest 描述将技能范围限定为按关键词搜索笔记、查看笔记详情与评论、单独获取评论数据、以及抓取博主公开作品列表,并强调返回结构化数据用于分析,不涉及更深层处理。更新日志在 L42 明确写到“新增小红书笔记详情与评论情绪分析功能”,这表明文档声明过一项比当前技能描述更宽的分析能力,存在技能宣称范围与实际/历史行为范围不一致的迹象。
The skill documentation is entirely written in Chinese and the natural-language trigger examples are all Chinese, with no indication that users may interact in other languages or choose a preferred locale. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.
This code sends an API token and note URL to a remote endpoint via postJson, which is a network operation involving potentially sensitive user/system data. While the JSDoc describes parameters, it does not warn users that their token and target URL will be transmitted, and there is no confirmation prompt or user-facing disclosure in this file.
Detected: suspicious.exposed_secret_literal