Back to skill

Security audit

guaikei-xhs-note-data

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated Xiaohongshu data-collection purpose, but it needs review because it sends API credentials in URL query strings and automatically saves collected results locally.

Install only if you are comfortable sending Xiaohongshu search terms, profile or note URLs, returned data, and your Guaikei API token to the Guaikei service. Treat generated logs as sensitive, delete them when no longer needed, avoid sharing or committing the package directory after use, and rotate the API token if it may have been exposed.

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/utils/request.js:76
Finding

API Credential Exposed in URL Query Strings

Content
View full analysis
{ return await postJson( "/api/xiaohongshu/note-search/keyword", { _: Date.now(), token: token }, { keyword, type, sort, time, limit }, ); }, constants.CREATE_MAX_ATTEMPTS, (attempt, err) => { utils.printError( `【创建任务重试】 ${attempt + 1}/${constants.CREATE_MAX_ATTEMPTS} 次 - ${err.message}`, ); }, ); } ``` The same pattern appears in the detail, comment, and post APIs: ```js return await postJson( "/api/xiaohongshu/detail/url", { _: Date.now(), token: token }, { url: url, limit: limit }, ); ``` ```js return await postJson( "/api/xiaohongshu/comment/url", { _: Date.now(), token: token }, { url, limit }, ); ``` ```js return await postJson( "/api/xiaohongshu/post/url", { _: Date.now(), token: token }, { url, limit }, ); ``` The shared HTTP implementation serializes all parameters, including the token, into the URL: ```js 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", heade ...[truncated 2789 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/utils/log.js:5
Finding

Automatic Plaintext Persistence of Query Inputs and API Results

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.dirname(outputFilename), { recursive: true }); await fs.promises.writeFile(outputFilename, content); utils.printSuccess(` → 已保存到 ${outputFilename}`); } catch (error) { utils.printError(`日志写入失败: ${error.message}`); } } ``` Every successful CLI operation invokes this function with the complete JSON response. For example, the search command persists the keyword, options, metadata, and all results: ```js console.log(JSON.stringify(finalOutput, null, 2)); utils.printSuccess( `搜索任务完成, 共返回 ${finalOutput.results.length} 条结果`, ); await log.taskWrite( `${startTime}_${keyword}_${type}_${sort}_${limit}_search.json`, JSON.stringify(finalOutput, null, 2), ); ``` The detail command uses the same behavior: ```js console.log(JSON.stringi ...[truncated 2965 chars]
Remediation
View remediation
` or `--save` so users consciously enable storage. 3. Clearly disclose what is stored, where it is stored, and how long it is retained. 4. Create directories and files with restrictive permissions: ```js await fs.promises.mkdir(path.dirname(outputFilename), { recursive: true, mode: 0o700, }); await fs.promises.writeFile(outputFilename, content, { mode: 0o600, flag: "wx", }); ``` 5. Redact unnecessary URL query parameters, including `xsec_token`, before writing request metadata or results. 6. Avoid including raw search keywords in filenames; use a random identifier or cryptographic hash instead. 7. Add configurable retention and secure cleanup controls. 8. Add `logs/` to `.gitignore` and exclude it from package publication, support bundles, and backup collection where appropriate. 9. Document that existing log files should be reviewed and deleted if continued retention is not required. ]]>
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 (68)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description presents a skill for assessing a Xiaohongshu blogger's real engagement level using likes, comments, and favorites across public works or a single note. However, the supplied code chunk only interfaces with comment-related API endpoints: one to create a comment scraping task from a note URL and one to fetch the resulting comments. This is a materially narrower and different behavior than the declared purpose. While comments are relevant to engagement, the code does not implement retrieval of likes or favorites, does not assess interaction quality, and does not analyze blogger-level performance. Therefore the description overstates the actual capability shown in this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的核心能力是分析某个小红书博主或单篇笔记的真实点赞、评论、收藏数据,从而评估互动质量与是否注水,重点在“博主/KOL评估”。但该代码片段的实际功能只是搜索模块:创建关键词搜索任务、获取搜索结果,并补充笔记/用户URL。它围绕关键词、排序、时间范围等参数检索笔记,不是围绕某个博主进行作品抓取和互动真实性评估,也没有看到对点赞/评论/收藏数的提取、校验、汇总分析或异常判断逻辑。因此其主要用途与声明明显不符,属于实质性能力偏差。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向小红书博主互动数据分析的技能,但提供的代码片段仅是通用CLI参数解析器,不包含任何网络请求、页面抓取、数据提取、指标计算或小红书相关处理逻辑。该代码的主要用途与声明的业务目标明显不一致,属于实质性功能不匹配,而非仅仅是底层辅助实现细节。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is a Xiaohongshu analytics capability, but the supplied code chunk implements only token management. While authentication can be a supporting detail, this chunk by itself does not perform or evidence the advertised behavior of fetching likes/comments/saves or evaluating engagement quality. Instead, its concrete behavior is validating a token and advertising a contact method for obtaining one, which is materially different from the user-facing description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向小红书数据采集与互动分析的技能,但提供的代码片段没有任何与小红书、博主作品、点赞/评论/收藏数据获取或分析相关的逻辑。相反,该代码只是在本地文件系统中写入日志文件,属于通用日志/持久化辅助功能。虽然日志记录可能是某些技能的支持性实现细节,但当前代码片段的实际功能与声明的核心目的完全不一致,且体现了未声明的本地文件写入能力。因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear mismatch between the declared purpose and the supplied code. The description claims the skill analyzes public Xiaohongshu engagement data, but the code merely reads package.json from the local filesystem and returns the package name. This behavior is unrelated to KOL evaluation, engagement analysis, or Xiaohongshu data access. While this could be a small helper utility within a larger skill, based on the supplied code chunk alone, its actual behavior does not match the declared functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a data-access and analytics skill focused on Xiaohongshu creator engagement metrics. However, the supplied code chunk contains only generic utility functions for printing a banner and formatted logs. While utility code can be a supporting detail within a larger system, this chunk by itself does not implement any of the core declared behavior. Therefore, the code's actual behavior materially differs from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向小红书 KOL 分析的技能,核心能力应包括抓取或读取公开作品/单篇笔记的互动数据,并据此评估真实互动水平。但给出的代码片段只处理输入层面的辅助逻辑:检查搜索关键词长度、非法字符、链接;清洗关键词;以及规范化搜索参数。虽然这些可能是搜索功能的配套实现细节,但从该片段本身看,完全没有体现声明中的核心业务行为。因此,代码实际行为与技能声明存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises a data retrieval and evaluation capability for Xiaohongshu creator engagement metrics. However, the supplied code chunk contains only helper functions for URL normalization, URL type checks, and URL-to-name conversion. These are supporting utilities at best, but in isolation they do not implement the core declared behavior of collecting public work data or computing true interaction levels. Because the actual code's primary behavior is materially narrower and different from the declared purpose, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

描述强调的是获取博主或笔记的真实点赞/评论/收藏统计数据,用于评估博主整体互动质量;而代码只处理“单篇笔记链接”的评论任务,参数也只有 URL 和评论数量 limit,没有任何博主维度、作品列表维度、点赞数、收藏数或互动率分析逻辑。其输出是 commentTask 评论结果,而不是互动质量评估结论或三项统计数据。因此代码行为仅覆盖了描述中很小的一部分(评论相关),且主要目的更接近“获取某篇笔记的评论内容/列表”,与宣称的KOL互动质量评估技能存在实质性不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明的核心能力是分析某个小红书博主或笔记的真实互动水平,重点是点赞、评论、收藏等数据用于KOL评估。但该代码块只是一个“search-cli”搜索入口,围绕关键词搜索内容构建任务并获取结果。参数设计也完全偏向搜索(keyword/type/sort/time/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 54)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 58)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 76)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 149)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 55)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 76)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 152)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 56)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 76)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 155)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