Back to skill

Security audit

小红书博主主页采集

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do its stated Xiaohongshu profile-collection job, but it uses account tokens and paid operations with unsafe defaults that need review before installation.

Review this skill before installing. Use it only if you accept a Chinese-language paid collection service, switch the backend to HTTPS before logging in if available, avoid enabling insecure TLS, and manually confirm each charged collect or session step. Treat the saved token and exported CSV files as sensitive, and check whether you want legacy credentials imported automatically.

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

Error
Location
src/config.js:19
Finding

Bearer Authentication Tokens Are Transmitted over Plaintext HTTP by Default

Content
View full analysis

Vulnerability Details

File Location: src/config.js:19, src/client.js:52-71, cli.js:319-320
Vulnerability Type: Plaintext transmission of authentication credentials
Risk Level: High

Technical Analysis

The built-in service endpoint uses plaintext HTTP:

js
const DEFAULT_BASE_URL = 'http://st.aidata366.com';

The API client attaches the account bearer token to requests made to this endpoint:

js
res = await fetch(this.baseUrl + '/api/v1' + apiPath, {
  method,
  headers: {
    ...(body ? { 'Content-Type': 'application/json' } : {}),
    ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}),
    ...headers,
  },
  body: body ? JSON.stringify(body) : undefined,
  signal: ctrl.signal,
});

Export downloads transmit the same token through the configured URL:

js
const res = await fetch(url,
  { headers: { Authorization: `Bearer ${cfg.token}` }, signal: dlCtrl.signal });

Unless the user explicitly changes the endpoint, authenticated commands therefore send reusable bearer credentials over an unencrypted and unauthenticated network channel. The warning emitted by the client does not prevent the request or protect its contents.

The affected operations include account profile and quota queries, collection task submission, task result access, session operations, logout, and export downloads.

Attack Path

  1. The user registers or logs in, causing an API bearer token to be stored locally.
  2. The user or agent invokes an authenticated command without overriding the default base URL.
  3. The client connects to http://st.aidata366.com and includes Authorization: Bearer <token>.
  4. A network-positioned attacker observes or intercepts the plaintext HTTP request.
  5. The attacker extracts and reuses the bearer token against API operations authorized for that token.
  6. Alternatively, an active attacker modifies API responses or downloaded CSV data because HTTP provides neither transport confidentiality nor server au ...[truncated 654 chars]
Remediation
View remediation

Remediation Suggestions

  1. Configure a valid TLS certificate and change the default endpoint to HTTPS.
  2. Reject authenticated requests to non-HTTPS remote endpoints rather than merely printing a warning.
  3. If plaintext HTTP is required for local development, restrict it to loopback destinations such as 127.0.0.1 and localhost.
  4. Require an explicit, narrowly scoped opt-in before permitting credentials over any other HTTP endpoint.
  5. Disable redirects that could forward authorization headers to an unintended origin, or validate every redirect destination before retaining credentials.
  6. Revoke or rotate tokens that may previously have been transmitted over untrusted plaintext networks.

T09 · Insecure Skill Coding Practices

Warning
Location
cli.js:208
Finding

Paid Collection Operations Do Not Enforce User Confirmation

Content
View full analysis

Vulnerability Details

File Location: cli.js:208-234, cli.js:367-375, SKILL.md:75-98
Vulnerability Type: Missing authorization confirmation for billable operations
Risk Level: Medium

Technical Analysis

The Skill documentation requires the agent to obtain user confirmation before submitting a paid collection task or advancing a paid session step. However, the executable entry point does not enforce that requirement.

The collection path calculates and displays the estimated charge but immediately submits the paid operation without requiring a confirmation parameter or quote identifier:

js
const { price } = await fetchPrice(cfg.baseUrl);
const estimatedPoints = pages * price;

const items = [{ id: 1, payload: { profile_url: profileUrl, pages } }];
const idemSource = `${profileUrl}|${pages}` + (opts.force ? `|#force:${Date.now()}` : '');
const idempotencyKey = crypto.createHash('sha256').update(idemSource).digest('hex').slice(0, 32);

process.stderr.write(
  `提交博主主页采集任务: url="${profileUrl}" 页数=${pages} (约 ${pages * BILL_UNIT} 条)\n` +
  `计费: 预扣 ${pages}×${price}=${estimatedPoints} 点 (每页 30 条=${price} 点), ` +
  `按实采量结算退差, 零结果/失败/博主被封全额返还 (幂等键 ${idempotencyKey}${opts.force ? ', force' : ''})...\n`);

const client = new ApiClient({ baseUrl: cfg.baseUrl, token: cfg.token });
const data = await client.submitTask(CAPABILITY, items, idempotencyKey, !!opts.force);

The session-step path likewise performs a billable operation immediately:

js
if (sub === 'step') {
  const sid = args[1];
  if (!sid) throw new UsageError('session step 需要 session_id 参数');
  process.stderr.write(`步进采集一页(30 条 = 5 点)session=${sid}...\n`);
  const data = await client.stepProfileSession(sid);
  if (data.no_more) {
    process.stderr.write('已没有更多笔记(本步未扣费)。可 session finish 结束会话释放节点。\n');
  } else {
    process.stderr.write(
      `第 ${data.page_no} 页完成: 新增 ${(data.notes || []).length} 条, ` +
      `累计 ${data.notes_collected} 条, has_more=${data.has_more}, 余额=${data.
...[truncated 1861 chars]
Remediation
View remediation

Remediation Suggestions

  1. Implement a server-issued quote containing the account, operation type, target URL or session, page count, unit price, total price, and expiration time.
  2. Require a short-lived confirmation identifier derived from that quote before accepting each paid request.
  3. For CLI-only enforcement, require an explicit confirmation flag bound cryptographically or structurally to the quoted parameters; a generic --yes flag is weaker because parameters may change after confirmation.
  4. Require a separate confirmation for every billable session step.
  5. Reject requests when the current server price differs from the price the user approved.
  6. Preserve idempotency protection, but do not treat idempotency as authorization; it prevents duplicate charging only for matching requests.
  7. Return a machine-readable confirmation-required response so agents cannot accidentally bypass the approval phase.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes shell, network, and environment-dependent behavior but declares no explicit tool restrictions or permission boundaries. That creates an over-privileged execution surface where an agent may run external commands or contact arbitrary endpoints beyond what users reasonably expect, increasing the chance of command misuse, data leakage, or unintended outbound access.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger text is broad and overlaps with common research, monitoring, and export requests, so the skill may be auto-invoked in situations the user did not explicitly intend. Because this skill performs paid collection, authentication flows, and data export, over-broad routing can cause unintended charges, unnecessary data handling, or execution of risky workflows without sufficiently clear user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The instructions require the agent to send fixed Chinese guidance text to the user and say the registration guidance must be forwarded verbatim. This imposes a specific language on user-facing interaction without any opt-in, alternative locale, or documented reason that the skill must communicate only in Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The package description is entirely in Chinese and presents the skill as a Chinese-language CLI without offering any language or locale choice. This can violate language/locale policy when the skill implicitly requires a specific language for use without explicit user opt-in or justification.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
96% confidence
Finding

allowInsecureTls() globally sets NODE_TLS_REJECT_UNAUTHORIZED=0, disabling certificate validation for the entire Node.js process rather than a single request or host. This allows active attackers on the network to impersonate backend services, intercept bearer tokens, and tamper with API responses, which is especially dangerous for a skill that submits authenticated scraping tasks and exports collected data.

Content

Scanner excerpt · src/client.js (reported line 17)May include surrounding context.

js
/** 忽略 HTTPS 证书校验 (服务端自签/域名不匹配证书时由 insecure 配置开启)。进程级。 */
function allowInsecureTls() {
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
}

/** 业务错误: code 为后端错误码 (1001/1002/3001/...) */

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The CSV download path performs a direct fetch with a bearer token but bypasses the centralized request() logic that emits warnings for plaintext HTTP and disabled TLS verification. As a result, the most sensitive operation in this client can transmit credentials over an insecure channel without the same disclosure or controls, increasing the chance of silent token exposure via misconfiguration or man-in-the-middle interception.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s natural-language comments and user-facing migration messages are written only in Chinese, including operational notices emitted to stderr. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code automatically reads credentials from another skill's legacy config and imports them into this skill without an explicit user consent step. That creates cross-skill credential sharing and can cause unintended token reuse, privilege confusion, or use of a token against a different backend than the user expected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file's documentation and emitted user-facing strings are written in Chinese, and the code does not offer any language or locale selection. That creates a natural-language policy concern if the broader skill environment expects language choice rather than forcing a specific locale by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code's natural-language interface is entirely in Chinese, including the file header and command help, with no indication that users can select another language. That can violate a language/locale policy when a skill is expected to avoid forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.