Back to skill

Security audit

guaikei-xhs-data-tool

Security checks for vulnerabilities and agentic risk

Overview

The skill broadly matches its Xiaohongshu public-data purpose, but it needs review because it sends its API token in request URLs and automatically saves full result data locally.

Install only if you are comfortable sending Xiaohongshu keywords/URLs and your Guaikei API token to guaikei.com. Run it in a private workspace, treat generated logs as sensitive, delete logs when no longer needed, and consider rotating the API token if request URLs may have been exposed in logs.

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 (2)

T09 · Insecure Skill Coding Practices

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

API Credential Transmitted in URL Query Parameters

Content
View full analysis
{ return await postJson( "/api/xiaohongshu/note-search/keyword", { _: Date.now(), token: token }, { keyword, type, sort, time, limit }, ); }, ``` The HTTP helper serializes this object directly into the request URL: ```javascript async function postJson(path, params, data) { if (!path || typeof path !== "string") { throw new Error("path 必须是非空字符串"); } if (!params || typeof params !== "object") { throw new Error("params 必须是对象"); } if (!data || typeof data !== "object") { throw new Error("data 必须是对象"); } 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", "Content-Length": Buffer.byteLength(jsonData), }, }; return await request(options, jsonData); } ``` The destination is fixed in `src/config/constants.js`: ```javascript module.exports = { BASE_URL: "www.guaikei.com", REQUEST_TIMEOUT: 20000, CREATE_MAX_ATTEMPTS: 3, QUERY_MAX_ATTEMPTS: 20, RETRY_INTERVAL: 2000, VERSION: "1.1.1", }; ``` ### Technical Analysis The value of `GUAIKEI_API_TOKEN` is placed in the query string of every API request. Although the requests use HTTPS and the fixed destination `www.guaikei.com`, HTTPS does not prevent the complete URL from being recorded after TLS termination. Query strings are commonly retained by: ...[truncated 1915 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/xiaohongshu/detail-cli.js:139
Finding

Automatic Plaintext Persistence of Full API Results and Access-Bearing URLs

Content
View full analysis
|]/g, "_") .replace(/\.\.+/g, "_") .replace(/^\.+|\.+$/g, ""); if (safeFilename.length > 200) { safeFilename = safeFilename.substring(0, 200); } if (safeFilename === "") { safeFilename = `log_${Date.now()}`; } const outputFilename = path.join( path.dirname(__filename), "..", "..", "logs", safeFilename, ); try { await fs.promises.mkdir(path.dirn ...[truncated 3235 chars]
Remediation
View remediation
` or `--save`. 2. Do not automatically save successful results when the user only requested stdout output. 3. Redact sensitive URL parameters before printing or storing data, especially `xsec_token`, `token`, `access_token`, and similarly named fields. 4. When local persistence is requested, create the directory and files with owner-only permissions: ```javascript await fs.promises.mkdir(logDirectory, { recursive: true, mode: 0o700, }); await fs.promises.writeFile(outputFilename, content, { mode: 0o600, flag: "wx", }); ``` 5. Warn before overwriting existing files, or use exclusive creation and securely generated filenames. 6. Add configurable retention and deletion controls, including an option for ephemeral execution with no stored results. 7. Avoid placing logs inside the source tree. Use an operating-system-appropriate private application-data directory. 8. Exclude result files from version control, build artifacts, support bundles, and container images. 9. Consider encryption at rest when datasets must be retained. 10. Document exactly what is stored, where it is stored, the retention period, and how users can delete it. 11. Add tests verifying that default execution creates no files and that stored output does not contain credential-bearing query parameters. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (73)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose describes a content discovery/search capability over Xiaohongshu notes based on keywords or topics, returning note metadata and engagement information. The actual code chunk is a comment module: it creates a comment scraping task for a given note URL via /api/xiaohongshu/comment/url and retrieves comment results via /api/xiaohongshu/comment/info. This is a materially different function from keyword-based note search and uses different inputs and outputs. Therefore the code does not accurately match the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的核心能力是“关键词搜索小红书公开笔记”,输入应是话题/品类/词,输出应是匹配笔记列表及其摘要信息。但代码实际调用的是 /api/xiaohongshu/detail/url 和 /api/xiaohongshu/detail/info 接口,参数是笔记链接 url 和评论数量 limit,功能是创建并查询单条笔记详情及评论任务,不是关键词检索。代码还会为笔记和用户拼接直达链接,明显属于详情抓取模块。两者主用途不同,属于实质性描述与行为不符。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是“按关键词搜索小红书公开笔记”,输入应是话题/品类/关键词,输出是相关笔记的标题、摘要、作者、互动数据和链接。但代码中两个核心函数 createPostTask 和 getPostTask 都以博主URL和limit作为参数,注释也明确写着“博主详情、已发布笔记模块”,接口路径同样指向 post/url 和 post/info,表明其主要能力是针对特定博主获取其已发布笔记,而不是进行关键词检索。因此代码的实际主要用途与声明存在实质性不一致。

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
98% confidence
Finding

声明的核心能力是检索并返回小红书公开内容,但提供的代码片段没有任何搜索、网络请求、社媒数据获取、结果解析或返回笔记信息的行为。相反,它执行的是与声明用途无关的本地日志文件写入操作,涉及文件系统访问这一未声明能力。该行为与“小红书搜索”主功能 materially different,因此应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose is a keyword-based Xiaohongshu content search tool that fetches and returns public note information. In contrast, the supplied code chunk contains only helper functions for URL normalization and classification of Xiaohongshu note/profile/short-link URLs, plus conversion of URLs into simple names. There is no search logic, no keyword handling, no fetching of public notes, and no extraction of titles, summaries, authors, engagement data, or jump links beyond recognizing URL patterns. This is a materially different behavior from the declared purpose, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明的核心功能是“小红书关键词搜索笔记”,面向话题/关键词检索并返回笔记级搜索结果。但实际代码文件 comment-cli.js 的主流程明确围绕评论获取:参数是 --url 和 --limit,帮助信息写的是“笔记链接”“评论数量”,调用的是 comment.createCommentTask 与 comment.getCommentTask,输出 request.command 也是 "comment"。代码既不接收关键词,也没有执行搜索笔记、返回标题摘要作者互动数据等搜索结果字段。虽然帮助文本中提到该 URL 可以来自 search-cli 的结果,但这只是把另一个工具的输出作为输入来源,不能说明本代码本身实现了搜索功能。因此描述与实际行为存在明显且实质性的不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

代码的核心输入是 --url/位置参数形式的“小红书笔记链接”,并明确要求是公开可访问的笔记 URL;可选参数 --limit 用于控制评论数量。程序调用 detail.createDetailTask 和 detail.getDetailTask,输出的是 command: "detail" 的结果,说明其主要功能是获取单篇笔记详情与评论,而不是根据关键词搜索多篇笔记。虽然帮助文本提到链接可来自 search-cli.js 的输出,但这只是与其他工具的衔接,不改变本代码块的实际用途。因此,描述与该代码块行为存在明显的主功能不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是“关键词搜索小红书公开笔记”的能力,核心输入应是某个话题、品类或词;而代码实际实现的是针对“小红书博主主页链接”获取该博主的主页笔记列表。代码中参数 --url/-u 被标记为必填,说明其主要用途并非搜索关键词,而是抓取指定博主主页内容;还通过 validator.isProfileUrl(url) 明确要求输入必须是博主主页 URL,并调用 post.createPostTask(token, url, limit) 与 post.getPostTask(token, url, limit) 执行“主页笔记任务”。因此,这不是轻微实现细节差异,而是主要功能、输入类型和目标资源都与声明明显不符。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 56)May include surrounding context.

md
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 67)May include surrounding context.

md
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 78)May include surrounding context.

md
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 117)May include surrounding context.

md
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 230)May include surrounding context.

md
- "分析这条小红书笔记评论区的主要观点和负面反馈: node src/xiaohongshu/detail-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

md
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 79)May include surrounding context.

md
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 129)May include surrounding context.

md
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 230)May include surrounding context.

md
- "看这个小红书博主最近 20 条作品都在发什么: node src/xiaohongshu/post-cli.js --url 'https://www.xiaohongshu.com/user/profile/xxx?xsec_token=yyy' --limit 20"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
- "只拉这条笔记的评论做观点归纳: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 58)May include surrounding context.

md
- "只拉这条笔记的评论做观点归纳: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 67)May include surrounding context.

md
- "只拉这条笔记的评论做观点归纳: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 80)May include surrounding context.

md
- "只拉这条笔记的评论做观点归纳: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 141)May include surrounding context.

md
- "只拉这条笔记的评论做观点归纳: node src/xiaohongshu/comment-cli.js --url 'https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy' --limit 100"

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