Back to skill

Security audit

xhs-profile

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but its default setup sends account tokens over plaintext HTTP and can spend paid credits without a code-enforced confirmation step.

Review before installing. Use only if you trust the service and understand it stores a reusable account token locally, sends it to the configured backend, and can spend paid quota. Prefer configuring an HTTPS backend before login, avoid insecure TLS mode, and require the agent to get explicit confirmation before every collect or session step because the CLI itself does not enforce that approval.

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

Bearer Credentials and Authentication Responses Transmitted over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: src/config.js:20; src/client.js:53-72
Vulnerability Type: Plaintext transmission of authentication credentials
Risk Level: High

Technical Analysis

The built-in service endpoint uses unencrypted HTTP:

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

The API client subsequently sends the user's bearer token to that endpoint in the Authorization header:

js
if (!_httpWarned && this.token && this.baseUrl.startsWith('http://')) {
  _httpWarned = true;
  process.stderr.write('[warn] 当前服务地址为明文 http,token 会明文传输,建议确认网络安全或切换 https\n');
}

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,
});

The stderr warning only reports the condition and does not stop or protect the request. Authenticated commands therefore transmit reusable bearer credentials without transport confidentiality or server authentication.

The registration and login checking flow also uses the default base URL and receives the newly issued token in an HTTP response before saving it. Consequently, the credential can be exposed even during its initial issuance, not only during later authenticated requests.

This crosses the trust boundary between the user's local credential store and the public network. A network-positioned adversary does not need to compromise the configured service or the user's account beforehand.

Attack Path

  1. The user runs registration, login, quota, collection, query, export, or session commands without replacing the default endpoint.
  2. The CLI connects to http://st.aidata366.com.
  3. During login or registration checking, the service returns the account token over plaintext HTTP ...[truncated 885 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the default endpoint with an HTTPS URL that has a valid, correctly scoped certificate.
  • Reject authenticated requests to non-HTTPS endpoints instead of merely printing a warning.
  • If plaintext HTTP is needed for local development, restrict it to loopback addresses and require an explicit development-only override.
  • Apply the HTTPS requirement to login and registration session checking because those responses carry newly issued credentials.
  • Do not recommend disabling certificate validation as a routine alternative. For private deployments, support an explicitly configured custom certificate authority.
  • After deploying HTTPS enforcement, revoke or rotate tokens that may previously have traversed untrusted networks over HTTP.

T09 · Insecure Skill Coding Practices

Warning
Location
cli.js:208
Finding

Paid Collection Operations Lack an Executable User-Confirmation Gate

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:80-96; cli.js:208-239; cli.js:366-371
Vulnerability Type: Unenforced authorization confirmation for paid operations
Risk Level: Medium

Technical Analysis

The Skill instructions require the agent to obtain user confirmation before submitting a whole collection job and before every paid session step. However, the executable paths do not require a confirmation token, approval parameter, quote identifier, or interactive confirmation.

The whole-job path calculates and prints an estimated charge but immediately submits the paid task:

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);

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

Likewise, the session-step path directly invokes the chargeable endpoint:

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);
  printOk(data);
  return;
}

The documentation-level confirmation requirement does not technically constrain direct CLI invocation by an agent, automation workflow, or other local caller that already has access to the configured account token. The informational stderr output is not an authorization check.

Attack Path

  1. An agent or automated workflow has access to the Skill and the user's saved API token.
  2. It invokes collect with a profile URL and page count, or invokes `se ...[truncated 928 chars]
Remediation
View remediation

Remediation Suggestions

  • Add a non-mutating quote command that returns the exact target, page count, unit price, maximum charge, account, and expiration time.
  • Require paid commands to present a short-lived confirmation token issued for that exact quote.
  • Bind the confirmation token to the authenticated account, profile URL, page count or session identifier, expected charge, and expiration.
  • Reject collect and productive session step requests when the confirmation token is absent, expired, reused, or does not match the operation.
  • Preserve idempotency protection, but do not treat an idempotency key as user authorization.
  • Provide a dry-run mode that cannot submit tasks or consume quota.
  • Ensure the server independently enforces the confirmation token so direct API calls cannot bypass the CLI check.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
95% confidence
Finding

The skill invokes shell commands, performs network access, and stores authentication tokens, but it does not declare any explicit tool/permission scope. That makes the runtime authority ambiguous and can let an agent execute sensitive operations more broadly than intended, including outbound requests over insecure HTTP and local file access to token-bearing config files. In this context, the risk is elevated because the skill is designed to drive paid scraping workflows and handle credentials.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description contains broad natural-language triggers such as requests about homepage notes, creator notes, exports, research, and monitoring, which can cause over-invocation outside a tightly scoped user intent. An agent may select this skill for loosely related requests and initiate scraping, login, billing, or data export actions that the user did not specifically intend. The danger is higher here because the skill can spend credits, collect third-party profile data, and persist exported results.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language interface is written entirely in Chinese, including the top-level description and all command help text, with no indication that users can opt into another language. This creates a locale/language policy issue because the skill imposes a single language on all users rather than offering choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The package description is entirely in Chinese and presents the skill as operating in that language without any indication that users may choose another language or locale. The policy explicitly flags language or locale constraints when they are imposed without opt-in or justification.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
97% confidence
Finding

allowInsecureTls() disables TLS certificate validation process-wide by setting NODE_TLS_REJECT_UNAUTHORIZED=0. That permits man-in-the-middle interception or impersonation of any HTTPS backend contacted by the process, which is especially dangerous here because the client transmits bearer tokens and accesses account/task 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
91% confidence
Finding

The CSV download path performs a separate fetch with a bearer token but does not reuse the insecure-HTTP warning logic present in request(). If baseUrl is configured as plain HTTP, the token can be sent in cleartext without any operator warning, increasing the chance of accidental credential exposure on untrusted networks.

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 file contains natural-language comments and stderr messages in Chinese, including operational guidance at L75-L76, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This file’s natural-language comments and multiple user-facing error/help strings are exclusively in Chinese, including operational guidance such as re-login and retry instructions. The file does not indicate that Chinese is optional, user-selected, or required for a region-specific skill, which can violate a language/locale policy requiring user choice or explicit justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code in pollTask constructs and throws new BizError(...), but BizError is not defined or imported in this module. When the timeout path is reached, this will raise a ReferenceError instead of the intended business exception, causing incorrect error handling, loss of structured timeout metadata, and potentially misleading exit behavior for callers and automation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language documentation and inline warnings in this file are written exclusively in Chinese, with no indication that the skill is intentionally region-specific or that users can choose another language. Under the stated policy, forcing a specific language without opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.