Back to skill

Security audit

小红书社媒指数采集

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated Xiaohongshu metrics purpose, but it handles account tokens and submitted links over an insecure default connection and can weaken TLS settings.

Install only if you trust this third-party service with your Xiaohongshu note URLs, xsec_token parameters, task results, and service account token. Prefer configuring an HTTPS backend before login or submission, do not enable insecure TLS except for controlled testing, and avoid shared machines because credentials are saved under ~/.xhs-platform/config.json and may be migrated from ~/.xhs-convert/config.json.

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

Error
Location
src/config.js:15
Finding
Bearer Credentials and Sensitive Collection URLs Transmitted over Plaintext HTTP## Vulnerability Details **File Location**: `src/config.js:15`, with credential transmission at `src/client.js:55-64` and `cli.js:294-295` **Vulnerability Type**: Cleartext transmission of sensitive information **Risk Level**: High ### Technical Analysis The Skill uses a plaintext HTTP endpoint as its default service URL: ```js const DEFAULT_BASE_URL = 'http://st.aidata366.com'; ``` The general API client constructs requests from this URL and adds the saved bearer token to authenticated requests: ```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, }); ``` The CSV download path likewise sends the bearer token directly to the configured endpoint: ```js const res = await fetch(`${cfg.baseUrl}/api/v1/platform/exports/${encodeURIComponent(info.export_id)}/file`, { headers: { Authorization: `Bearer ${cfg.token}` } }); ``` Consequently, authenticated commands executed with the default configuration transmit bearer credentials without transport encryption. Task submissions also include user-supplied Xiaohongshu URLs containing `xsec_token` values in plaintext request bodies. Registration and login-session operations use the same default service origin. Users can override `base-url` with an HTTPS URL, but this does not protect the documented and coded default path. There is no scheme enforcement that prevents authenticated operations over HTTP. ### Attack Path 1. A user registers, logs in, or runs an authenticated command while retaining the default base URL. 2. The CLI connects to `http://st.aidata366.com` without TLS. 3. For authenticated operations, the CLI sends `Authorization: Bearer <token>` over the plaintext connection. Submissio ...[truncated 1110 chars]
Remediation
## Remediation Suggestions 1. Replace the default endpoint with an HTTPS URL using a valid, trusted certificate. 2. Reject `http://` base URLs for login, registration, authenticated API requests, submissions containing `xsec_token`, and export downloads. 3. Validate the effective URL after applying command-line, environment, and configuration overrides; do not rely only on the default value. 4. If plaintext HTTP is needed for local development, permit it only for loopback addresses through an explicit development-only option, and never send production credentials through that mode. 5. Remove or tightly restrict the process-wide `NODE_TLS_REJECT_UNAUTHORIZED=0` behavior. Prefer a narrowly scoped custom CA configuration for private deployments. 6. Invalidate existing bearer tokens if they may have been used through the plaintext default endpoint, and issue replacement credentials after HTTPS enforcement is deployed. 7. Add automated tests confirming that credential-bearing requests fail before transmission when the effective service URL is not securely authenticated.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill description omits sensitive operational behaviors such as credential/config persistence, migration of legacy tokens from another skill, and base URL/insecure-flag resolution. These behaviors materially expand trust assumptions and can expose existing credentials or redirect traffic to unintended endpoints if users are not clearly informed.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill description omits sensitive operational behaviors such as credential/config persistence, migration of legacy tokens from another skill, and base URL/insecure-flag resolution. These behaviors materially expand trust assumptions and can expose existing credentials or redirect traffic to unintended endpoints if users are not clearly informed.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
This code can globally disable TLS certificate verification by setting NODE_TLS_REJECT_UNAUTHORIZED=0, which weakens HTTPS for the entire Node.js process, not just this client. In a skill that handles authentication tokens and account operations, this enables man-in-the-middle interception or tampering of credentials, session tokens, and task data when insecure mode is used.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill advertises network access, token handling, and environment/config interactions but does not declare any explicit tool scope or permissions boundary. That makes the effective capability set opaque to the host and user, increasing the risk of over-broad execution and unintended access to local state or external services.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs users to submit Xiaohongshu note links to a third-party backend but does not prominently warn that those user-provided URLs and related metadata will be transmitted off-platform. This lack of privacy transparency can lead to inadvertent disclosure of browsing targets, identifiers, and tracking parameters such as xsec_token to an external service.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file's natural-language interface and operational instructions are entirely in Chinese, including usage text and user-facing prompts, and there is no indication that users can opt into another language. Under the stated policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
/** 忽略 HTTPS 证书校验 (服务端自签/域名不匹配证书时由 insecure 配置开启)。进程级, 仅提示一次。 */
function allowInsecureTls() {
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
  if (!_insecureNoted) {
    _insecureNoted = true;
    process.stderr.write('[warn] 已按配置忽略 HTTPS 证书校验(insecure=true)\n');
Confidence
98% confidence
Finding
Setting NODE_TLS_REJECT_UNAUTHORIZED = '0' creates an unsafe default capability that disables server certificate validation process-wide. Even if intended for self-signed certificates, this materially reduces transport security and can expose bearer tokens, login credentials, SMS auth flows, and exported data to interception or response spoofing.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a tool for collecting/querying Xiaohongshu note engagement metrics and exporting CSV results. This client also implements SMS code sending, user registration, login/logout, CLI session creation/checking, and profile retrieval, which are broader account-management capabilities not described as part of the skill's purpose.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The code automatically reads a token, base URL, and insecure flag from another skill's configuration file and imports them into this skill without explicit user consent or clear authorization boundaries. This creates cross-skill credential sharing and trust confusion: a token intended for one service or skill can be silently reused here, potentially exposing credentials to an unintended tool or endpoint, especially since the migrated base URL and insecure settings also influence network behavior.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file’s comments and multiple user-facing error/help strings are written in Chinese, and the module emits those strings directly to users via stdout/stderr. There is no indication of locale selection, opt-in, or documentation that this skill is intentionally region-specific, which creates a language policy concern.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
Lines L37-L46 append Chinese-language remediation guidance to error messages that are presented to end users. Because the file does not provide any alternate locale or opt-in mechanism, it enforces a specific language in user-visible behavior.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The manifest description is entirely prescriptive in Chinese and describes when the skill should be used, but it does not indicate that users may choose another language or locale. Under the policy for natural-language issues, forcing a specific language without opt-in can be a locale-policy violation.

Missing User Warnings

Low
Confidence
81% confidence
Finding
The documentation notes that authentication tokens are stored locally in a user-level config file, but the warning is not sufficiently prominent before users begin the login/registration flow. Because these tokens enable access to the service account, understated disclosure can cause users to leave reusable credentials on shared systems without understanding the risk.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
The package description is written entirely in Chinese and indicates the skill is for '小红书' social media metrics, which implies a fixed language/locale context without any stated user choice or opt-in. Under the policy, language or locale constraints should be explicitly optional or clearly justified.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
This file contains user-facing and developer-facing natural-language text such as module documentation and the TLS warning message exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in is a locale/language policy violation unless a justified region-specific constraint is documented.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The file’s natural-language documentation is written exclusively in Chinese, which can indicate a language-specific constraint without any stated user choice or opt-in. Under the policy rule, forced language or locale expectations should be documented as optional or justified.

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
src/client.js:15