Back to skill

Security audit

guaikei-xhs-public-data-tool

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Xiaohongshu public-data integration, with cautions around third-party API use, local result logs, and API-token handling.

Install only if you are comfortable sending Xiaohongshu keywords or URLs and your GUAIKEI_API_TOKEN to guaikei.com. Use a dedicated, revocable token, be aware results are saved locally under logs, and avoid processing private or sensitive data through this public-data scraper.

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:76
Finding

API Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Locations:

  • src/api/search.js:20-28
  • src/api/search.js:52-59
  • src/api/comment.js:17-25
  • src/api/comment.js:46-51
  • src/api/detail.js:20-23
  • src/api/detail.js:46-51
  • src/api/post.js:20-23
  • src/api/post.js:46-51
  • src/utils/request.js:76-98
  • src/utils/request.js:101-119

Vulnerability Type: Credential exposure through URL query parameters
Risk Level: Medium
Classification: T09: Insecure Skill Coding Practices

Vulnerable Code

Task creation includes the API token in the query-parameter object:

js
async function createSearchTask(token, keyword, type, sort, time, limit) {
  return await withRetry(
    async () => {
      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}`,
      );
    },
  );
}

Polling requests also include the token in their query parameters:

js
const res = await getJson("/api/xiaohongshu/note-search/info", {
  _: Date.now(),
  token: token,
  keyword,
  type,
  sort,
  time,
  limit,
});

The shared request utility serializes every supplied parameter 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
...[truncated 3349 chars]
Remediation
View remediation

Remediation Suggestions

  1. Move authentication out of the URL. Send the credential in an HTTP authorization header:

    js
    const options = {
      host: constants.BASE_URL,
      path: fullPathWithoutToken,
      method: "GET",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${token}`,
      },
    };
    
  2. Separate credentials from ordinary request parameters. Change getJson and postJson to accept the token separately so callers cannot accidentally serialize it:

    js
    async function getJson(path, params, token) {
      params._ = Date.now();
      const fullPath = `${path}?${querystring.stringify(params)}`;
    
      return request({
        host: constants.BASE_URL,
        path: fullPath,
        method: "GET",
        headers: {
          Accept: "application/json",
          Authorization: `Bearer ${token}`,
        },
      });
    }
    
  3. Update every API call site. Remove token from the parameter objects in search.js, comment.js, detail.js, and post.js, including both task-creation and polling requests.

  4. Apply defense-in-depth redaction. Configure gateways, proxies, application logs, tracing tools, and error-reporting systems to redact query parameters named token, api_key, authorization, and similar sensitive fields.

  5. Avoid credential logging. Ensure debugging and error handling never serialize request options or authorization headers without redaction.

  6. Rotate potentially exposed credentials. Tokens previously used by affected versions should be rotated if complete URLs may have been retained by server or infrastructure logs.

  7. Reduce credential replay risk. Where supported by the service, use short-lived scoped tokens, token expiration, per-client scopes, and revocation controls.

  8. Add regression tests. Assert that generated request paths never contain the token or sensitive pa ...[truncated 79 chars]

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims link-routing behavior but the implementation reportedly performs keyword search, filtering, task creation/polling, and logging instead. This is a clear behavioral mismatch with potential privacy impact because different categories of user input may be collected, persisted, and transmitted externally without accurate disclosure.

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"