Back to skill

Security audit

guaikei-rednote-radar

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Xiaohongshu public-data retrieval tool, but users should understand it sends requests through Guaikei's API and stores local result logs.

Install only if you are comfortable sending Xiaohongshu keywords, note/profile URLs, returned public data, and your GUAIKEI_API_TOKEN to Guaikei's API. Treat the token like a password, rotate it if exposed, and be aware that command results are saved locally under 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
src/utils/request.js:83
Finding

API Credential Exposed in HTTP Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:83-109; credential parameters originate from src/api/comment.js:20-23,46-50, src/api/detail.js:20-23,46-50, src/api/post.js:20-23,46-50, and src/api/search.js:23-26,52-59
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

The shared HTTP helpers serialize all parameters, including the API token, into the request 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",
    headers: {
      "Content-Type": "application/json",
      "Content-Length": Buffer.byteLength(jsonData),
    },
  };
  return await request(options, jsonData);
}

async function getJson(path, params) {
  if (!path || typeof path !== "string") {
    throw new Error("path 必须是非空字符串");
  }
  if (!params || typeof params !== "object") {
    throw new Error("params 必须是对象");
  }
  params._ = Date.now();

  const fullPath = `${path}?${querystring.stringify(params)}`;
  const options = {
    host: constants.BASE_URL,
    path: fullPath,
    method: "GET",
    headers: {
      "Content-Type": "application/json",
    },
  };
  return await request(options);
}

For example, the search API explicitly supplies the credential as a query parameter for both task creation and result retrieval:

js
return await postJson(
  "/api/xiaohongshu/note-search/keyword",
  { _: Date.now
...[truncated 2633 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove token from every query parameter object in the API modules.

  2. Pass the credential through a standard authorization header, for example:

    js
    const options = {
      host: constants.BASE_URL,
      path: fullPath,
      method: "GET",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${token}`,
      },
    };
    
  3. Refactor getJson and postJson to accept authentication separately from ordinary request parameters, preventing callers from accidentally placing secrets in URLs.

  4. Configure the API server, reverse proxies, gateways, and monitoring systems to redact authorization data and sensitive query parameters.

  5. Avoid logging complete request headers or URLs in application errors and diagnostic traces.

  6. Rotate credentials that have previously been transmitted in query strings because they may already exist in historical logs.

  7. Apply least-privilege scopes, expiration periods, quotas, and revocation controls to API tokens.

  8. Add automated tests asserting that generated request paths never contain token, api_key, authorization, or other credential fields.

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是一个较完整的小红书互动数据分析技能,覆盖博主公开作品和单篇笔记的真实点赞/评论/收藏数据,并进一步用于评估互动质量和判断是否注水。但实际代码块只包含评论模块:创建评论任务和查询评论任务结果,输入是笔记链接和评论数量限制,输出是评论数组。它没有显示获取点赞数、收藏数、作品列表、博主维度汇总,也没有任何分析或评估逻辑。因此代码行为仅覆盖声明中的一小部分,而且主能力明显更窄,属于实质性描述不符。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose centers on evaluating a Xiaohongshu blogger/KOL's real engagement using public works and per-note metrics such as likes, comments, and favorites. However, this code chunk is specifically a search module for creating and querying keyword-based note search tasks. Its inputs are keyword, content type, sorting, time range, and result limit—not a blogger identifier. The code does not analyze engagement quality, estimate authenticity, or focus on a creator's corpus. It also constructs note and user profile URLs from search results. While search could be tangentially useful in a larger Xiaohongshu workflow, this chunk's primary behavior is materially different from the declared KOL engagement assessment purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向小红书博主互动数据分析的技能,但提供的代码片段只是底层通用CLI参数解析器,不包含任何与小红书、KOL筛选、公开作品抓取、单篇笔记数据读取或互动质量评估相关的实现。虽然参数解析可能作为某个更大工具的辅助模块存在,但就该代码块本身而言,其实际行为与声明目的明显不一致,属于材料性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明的核心功能是分析小红书博主公开互动数据,但提供的代码仅实现了本地TOKEN格式校验和提示信息输出,没有任何网络请求、数据抓取、作品/笔记处理、点赞评论收藏统计或互动质量评估逻辑。虽然TOKEN管理可作为某些技能的辅助实现,但当前代码片段的实际行为与声明用途之间缺乏直接对应,且其主要可见功能是校验TOKEN并引导用户联系微信获取私有TOKEN,因此与声明描述存在明显不匹配。

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 skill focused on retrieving public engagement metrics and assessing influencer interaction quality. The actual code chunk does not retrieve Xiaohongshu data, analyze engagement, or interact with any network/API source. Instead, it performs local file output by writing content into a logs directory. Local filesystem logging may be a supporting utility in a larger system, but in this isolated chunk the behavior is materially unrelated to the declared primary purpose and introduces an undeclared capability: writing arbitrary content to disk.

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 description and implementation. The declared purpose is a social-media analytics capability focused on Xiaohongshu engagement metrics, but the actual code chunk merely reads package.json from the local filesystem and returns the package name. This behavior does not implement, or even meaningfully support, the stated functionality of fetching likes/comments/favorites or assessing KOL interaction quality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该代码片段只是一个通用工具模块,功能限于打印 banner 和日志,不访问小红书、不处理作品/笔记数据、也不做任何互动指标分析。声明描述的是一个面向小红书博主真实互动数据评估的技能,而当前代码的实际行为是纯粹的控制台输出辅助功能,主目的明显不一致,因此应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向小红书博主数据分析的技能,核心能力应包括访问公开作品或单篇笔记数据,并据此评估真实互动水平。但给出的代码片段只处理输入关键词的合法性检查、关键词清洗,以及搜索选项参数的标准化,属于搜索前的辅助校验逻辑。它没有表现出任何与小红书平台数据获取、互动指标提取、真实性分析或KOL评估直接相关的行为。因此,这段代码与声明用途存在明显的实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a data-collection and analytics capability focused on obtaining real engagement statistics for Xiaohongshu creators and notes. However, the supplied code chunk is limited to helper functions for URL handling: normalizing URLs, checking whether a URL matches note/profile patterns, and converting a URL into a filename-like string. This is only a supporting utility and does not implement the declared primary purpose. Because the actual behavior is materially narrower and different from the stated skill functionality, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个用于评估小红书博主真实互动水平的技能,核心能力应包括获取单篇笔记或博主作品的真实点赞、评论、收藏数据,并据此进行互动质量分析。实际代码仅实现了一个 comment-cli:输入笔记链接后创建评论抓取任务并返回评论结果。代码中没有看到点赞数、收藏数、博主作品列表、博主级聚合分析、互动率计算、注水识别或合作决策支持等逻辑。因此其实际主要用途与声明不一致,属于能力明显缩水且方向偏移的描述-行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

代码的核心行为是:输入小红书博主主页 URL,校验后调用 post.createPostTask 和 post.getPostTask 获取博主主页笔记结果,并将结果输出/记录。它与声明有部分相关性,因为都围绕小红书博主公开内容数据展开;但声明的重点是“获取公开作品及单篇笔记的真实点赞/评论/收藏数据,并评估互动质量”,而该代码块既不处理单篇笔记 URL,也没有任何分析、去水分判断或互动质量评估逻辑。因此,实际行为只覆盖了声明中的一部分,而且缺失了声明中的关键能力,构成描述与行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description focuses on evaluating a Xiaohongshu blogger/KOL by obtaining public works and true engagement metrics for notes, for collaboration and anti-fraud assessment. The supplied code does not implement blogger-centric analysis, authenticity assessment, or explicit extraction of a blogger's portfolio/engagement metrics. Instead, it parses CLI arguments for a keyword search, validates/sanitizes the keyword, calls search.createSearchTask and search.getSearchTask, and returns generic search results filtered by type/sort/time/limit. This is a materially different primary purpose from KOL engagement evaluation, so it is a mismatch.

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 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 120)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 147)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 229)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 77)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 132)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 229)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"

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