Back to skill

Security audit

guaikei·小红书爆款笔记查找

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Xiaohongshu data-analysis tool, but it handles API tokens and saved results in ways users should review before installing.

Install only if you are comfortable sending Xiaohongshu links, search terms, requested limits, and a GUAIKEI API token to guaikei.com. Use a dedicated token with limited scope if possible, avoid running sensitive investigations in shared workspaces, and delete or protect the generated logs. The publisher should move authentication out of URL query strings and make local result saving explicit and redactable.

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

API Token Transmitted in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: src/utils/request.js:72-99; token-bearing parameters originate from src/api/search.js:23-25,52-54, src/api/detail.js:20-22,46-48, src/api/comment.js:20-22,46-48, and src/api/post.js:20-22,46-48
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

js
async function postJson(path, params, data) {
  if (!path || typeof path !== "string") {
    throw new Error("path must be a non-empty string");
  }
  if (!params || typeof params !== "object") {
    throw new Error("params must be an object");
  }
  if (!data || typeof data !== "object") {
    throw new Error("data must be an object");
  }
  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);
}

A representative caller explicitly places the API token in params:

js
return await postJson(
  "/api/xiaohongshu/note-search/keyword",
  { _: Date.now(), token: token },
  { keyword, type, sort, time, limit },
);

The same behavior occurs for GET polling requests:

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

Technical Analysis

postJson and getJson serialize all parameter properties into the request URL. Because each API caller includes token, the value of GUAIKEI_API_TOKEN becomes part of every outbound URL.

HTTPS protects the URL from passive network interception while it is in transit, but it does not prevent the complete reque ...[truncated 1383 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove token from every query-parameter object.

  2. Transmit the credential through an authorization header, such as:

    js
    headers: {
      "Authorization": `Bearer ${token}`,
      "Content-Type": "application/json",
    }
    
  3. If the service does not support bearer authentication, transmit the credential in the HTTPS request body rather than the URL and update the server accordingly.

  4. Configure API gateways, reverse proxies, observability platforms, and application logs to redact tokens and sensitive query parameters.

  5. Avoid including complete request URLs in exceptions or diagnostic output.

  6. Rotate tokens that have already been transmitted through query strings, particularly if infrastructure logs may be broadly accessible.

  7. Add automated tests that assert authentication credentials never appear in constructed request paths.

T09 · Insecure Skill Coding Practices

Note
Location
src/utils/log.js:25
Finding

Retrieved Data and Tokenized URLs Automatically Persisted in Plaintext

Content
View full analysis

Vulnerability Details

File Location: src/utils/log.js:25-34; automatic persistence is invoked from src/xiaohongshu/search-cli.js:207-211 and src/xiaohongshu/detail-cli.js:154-158, with equivalent behavior in the other successful CLI workflows
Vulnerability Type: Insecure local storage and undisclosed data retention
Risk Level: Low

Vulnerable Code

js
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(`  → Saved to ${outputFilename}`);
} catch (error) {
  utils.printError(`Log write failed: ${error.message}`);
}

Successful detail results are automatically passed to the file-writing function:

js
await log.taskWrite(
  `${startTime}_${validator.url2Name(url)}_detail.json`,
  JSON.stringify(finalOutput, null, 2),
);

Search results are persisted in the same manner:

js
await log.taskWrite(
  `${startTime}_${keyword}_${type}_${sort}_${limit}_search.json`,
  JSON.stringify(finalOutput, null, 2),
);

Returned API records can contain generated URLs carrying xsec_token values:

js
if (res.data.id && res.data.xsec_token) {
  res.data.url =
    "https://www.xiaohongshu.com/explore/" +
    res.data.id +
    "?xsec_token=" +
    res.data.xsec_token;
}

Technical Analysis

Every successful CLI operation writes the complete structured response to a predictable logs/ directory inside the project. Persistence is automatic rather than opt-in, and writeFile is invoked without an explicit restrictive file mode.

The stored JSON may include:

  • Search keywords and requested Xiaohongshu URLs.
  • Public note, profile, commenter, and interaction data.
  • Complete API response objects.
  • Generated Xiao ...[truncated 1496 chars]
Remediation
View remediation

Remediation Suggestions

  1. Make result persistence opt-in through an explicit option such as --output.

  2. Clearly document when, where, and for how long retrieved data is retained.

  3. If persistence is enabled, create files with owner-only permissions:

    js
    await fs.promises.writeFile(outputFilename, content, { mode: 0o600 });
    
  4. Create the containing directory with restrictive permissions where supported.

  5. Redact sensitive query parameters such as xsec_token before writing URLs to disk.

  6. Store only fields required by the user rather than the complete raw API response.

  7. Add configurable retention and automatic deletion controls.

  8. Add logs/ to .gitignore and exclude it from package publication, synchronization, and routine backups unless retention is explicitly required.

  9. Warn users before saving datasets that may contain personal or account-related information.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (41)

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
- "分析这条小红书笔记评论区的主要观点和负面反馈: 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 105)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 40)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 130)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 136)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 41)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 110)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 118)May include surrounding context.

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

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says the skill should be used even when the user did not explicitly ask for comment analysis, as long as they provide a note link and care about audience feedback. That broad auto-applicability can cause over-invocation and send user-provided links and analysis targets to the external API without sufficiently explicit user intent, increasing privacy and consent risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Although the document mentions dependence on a third-party API in a compliance section, the primary usage flow does not prominently warn that user-supplied Xiaohongshu links, keywords, and query parameters will be transmitted to guaikei.com. This weak disclosure can mislead users about where their data goes and creates a data exfiltration/privacy concern if the skill is invoked automatically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The package description and keywords are entirely in Chinese and target a specific locale/platform context without indicating any user language choice or documenting that the skill is intentionally region-specific. Under the policy, language or locale constraints should be opt-in or clearly justified rather than implicitly enforced.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README presents all user-facing instructions and operational guidance only in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not stated here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents behaviors that retrieve public note details, comment content, and creator post data for analysis, including competitor monitoring and opinion analysis. Under the markdown-specific warning rule, the description should disclose that the skill accesses and analyzes third-party platform data and user-generated content, but no such warning is present in these sections.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code sends an API token and a user-supplied note URL to a remote endpoint via postJson, but the file provides no user-facing disclosure such as a confirmation prompt, visible log, or warning comment about transmitting that data. Under the code-file criteria, network calls that transmit user or system data should be flagged when there is no visible disclosure and the file itself does not indicate that such transmission is expected to the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The getJson call sends the API token along with the URL and limit to a remote service, yet this file contains no visible user warning, confirmation, or explanatory comment about that outbound data transfer. Because network calls that transmit user or system data are in scope for missing-warning checks on code files, this lacks the required disclosure signal.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code sends the token parameter as part of outbound HTTP requests when creating a search task. Although the operation is documented in code comments, there is no visible confirmation prompt or user-facing disclosure that credentials are being transmitted to an external API.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The function sends both the user's search keyword and the API token in an outbound request to retrieve task results. For a code file, this is a data-transmitting network operation involving potentially sensitive inputs, but the file provides no user-facing warning or confirmation beyond internal comments and retry-error logging.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The user-facing strings are hard-coded in Chinese and there is no indication that the skill is intended only for Chinese-speaking users or that another language can be selected. This creates a natural-language policy issue because the skill imposes a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code emits user-facing error messages in Chinese (for example at L07 and L11), and also continues that pattern in success/error output later in the file. Because the file provides no user opt-in, language selection, or documentation that the skill is intentionally China/Chinese-locale specific, it creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This code constructs and sends POST requests using caller-provided query parameters and JSON body data, which can transmit user or system data over the network. The file contains no confirmation prompt, logging/print statement, or explanatory comment/docstring disclosing this network transmission behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The getJson function serializes caller-provided params into the request URL and sends them to a remote host. There is no confirmation, user-visible log, or inline documentation warning that supplied parameters may be transmitted to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code emits all validation and error text in Chinese string literals, which forces a specific language on users. The provided file contains no indication of user opt-in, language selection, or a documented region-specific justification, so it conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This CLI persists fetched comment results to a local JSON file automatically, but gives no explicit warning or opt-in to the user before storing potentially sensitive or regulated content on disk. In shared environments, developer workstations, CI runners, or systems with weak file protections, this can create unintended data retention and secondary exposure of scraped content and request metadata.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

With no manifest available, the skill's purpose and expected capabilities are unknown. This CLI reads a credential-like environment variable (GUAIKEI_API_TOKEN) to perform its work, which is a sensitive capability that is not justified by any stated purpose or manifest scope in the provided context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The CLI writes the full fetched detail result to a local JSON file, potentially persisting scraped note and comment data that may contain personal or sensitive information. Local persistence increases data exposure risk through accidental sharing, weak file permissions, backups, or multi-user host access, especially because the file is created automatically after successful execution.

Content

No source excerpt is available for this finding.