Back to skill

Security audit

小红书转链

Security checks for vulnerabilities and agentic risk

Overview

This paid XiaoHongShu link-conversion skill is coherent, but it handles account tokens over plaintext HTTP by default, so it needs Review before use.

Only install if you are comfortable using a paid third-party service that stores a reusable local token shared with xhs-dpt. Prefer configuring an HTTPS backend with valid certificates before logging in or submitting links; avoid insecure=true and do not use untrusted base URLs because tokens, submitted links, quota/profile data, and task results may otherwise be exposed.

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/client.js:52
Finding

Bearer Credentials and Account Data Transmitted over Plaintext HTTP by Default

Content
View full analysis

Vulnerability Details

File Location: src/config.js:14, src/client.js:52-66
Vulnerability Type: Plaintext transmission of authentication credentials and sensitive account data
Risk Level: High

Complete Code Snippet

src/config.js:14:

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

src/client.js:52-66:

js
// 明文 http + 携带 token 时提示一次 (每进程仅一次), 不打断请求
if (!_httpWarned && this.token && this.baseUrl.startsWith('http://')) {
  _httpWarned = true;
  process.stderr.write('[warn] 当前服务地址为明文 http,token 会明文传输,建议确认网络安全或切换 https\n');
}
const ctrl = new AbortController();
const timer = setTimeout(() => ctrl.abort(), REQUEST_TIMEOUT_MS);
let res;
let payload = null;
try {
  res = await fetch(this.baseUrl + '/api/v1' + apiPath, {
    method,
    headers: {
      ...(body ? { 'Content-Type': 'application/json' } : {}),
      ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}),
      ...headers,
    },

Technical Analysis

The built-in service endpoint uses plaintext HTTP. The API client then attaches the user's bearer token to the Authorization header for authenticated requests to that endpoint. The implementation recognizes this exposure but only prints a warning and proceeds with the request.

The same plaintext channel is also used for CLI authentication-session creation and checking. Consequently, authentication-session values and the bearer token returned by a successful session check can cross the network without confidentiality or authenticated transport. Authenticated API responses and submitted task data are similarly exposed to interception or modification.

This is a reachable default execution path rather than an optional misconfiguration: absent a command-line, environment, or saved configuration override, resolveConfig() selects the HTTP endpoint.

Attack Path

  1. A user invokes the Skill using its default configuration and registers, logs in, checks quota, submits a conversion task, queries ...[truncated 1620 chars]
Remediation
View remediation

Remediation Suggestions

  1. Change the production default endpoint to an HTTPS URL with a valid certificate.
  2. Reject non-HTTPS service URLs whenever authentication-session material or bearer credentials would be transmitted.
  3. If local development support is required, restrict plaintext HTTP to explicit loopback destinations such as 127.0.0.1 or localhost, and require an explicit development-only opt-in.
  4. Replace the warning-only check with a fail-closed validation before creating any authentication session or authenticated request.
  5. Keep TLS certificate verification enabled. Remove or tightly constrain the process-wide NODE_TLS_REJECT_UNAUTHORIZED=0 mode because it defeats server authentication for HTTPS connections in the process.
  6. Revoke and rotate tokens that may already have traversed plaintext networks after deploying HTTPS enforcement.
  7. Add automated tests confirming that HTTP production endpoints are rejected and that bearer headers are only attached to verified HTTPS destinations.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The advertised behavior is simple link conversion, but the skill also stores authentication tokens, persists configuration, shares credentials with another skill, allows base-URL override, and supports insecure TLS bypass via XHS_PLATFORM_INSECURE=1. This hidden operational scope increases the chance of credential misuse, redirection to attacker-controlled backends, and insecure transport without users or orchestrators realizing the full risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The CLI allows users or upstream automation to change the backend base URL arbitrarily and to disable TLS certificate verification. Together, these options can redirect authenticated requests and tokens to an attacker-controlled server or enable man-in-the-middle interception, which is especially dangerous because this tool handles login tokens and account operations in addition to link conversion.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill exposes network, shell, and environment-backed behavior but does not declare an explicit tool/permission scope, so an agent may invoke it without clear sandboxing or least-privilege constraints. In this skill, that ambiguity matters because it performs authenticated network calls, handles tokens, and can modify persistent local configuration.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger terms are broad enough that normal conversation about XiaoHongShu links or conversion could auto-select this skill even when the user did not intend to invoke a paid, authenticated external service. In context, that can lead to unnecessary credential prompts, persistent token creation, quota consumption, and external transmission of user-supplied links.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code embeds its primary usage text and operational prompts entirely in Chinese, which effectively forces a specific language/locale on users. The file does not provide any opt-in, alternate locale, or documented justification for the restriction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes this skill as a batch Xiaohongshu note-link conversion tool, but the CLI exposes broader account-management capabilities: registration, login, token persistence, quota/profile lookup, logout, and backend configuration. While authentication is an implementation detail for a paid service, these user/account operations are materially broader than the narrow 'convert links' purpose stated in the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code explicitly states that credentials are shared with another skill via a common config file, but this cross-skill credential sharing is not disclosed in the manifest description. Shared tokens increase the blast radius of compromise: misuse, leakage, or logout in one skill affects another, and users may not realize one skill can access credentials obtained by the other.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
98% confidence
Finding

The code explicitly disables TLS certificate verification process-wide by setting NODE_TLS_REJECT_UNAUTHORIZED='0'. This enables man-in-the-middle attacks against all subsequent HTTPS requests in the process, allowing interception or modification of API traffic, including bearer tokens and task data; in this skill’s context, that is especially risky because it handles authenticated API calls and even warns that tokens may be sent over insecure transport.

Content

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

js
/** 忽略 HTTPS 证书校验 (服务端自签/域名不匹配证书时由 insecure 配置开启)。进程级, 仅提示一次。 */
function allowInsecureTls() {
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
  if (!_insecureNoted) {
    _insecureNoted = true;
    process.stderr.write('[warn] 已按配置忽略 HTTPS 证书校验(insecure=true)\n');

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a batch XiaoHongShu link conversion tool, but the file documentation and code implement persistent user-level configuration and token sharing with another skill (xhs-dpt). Persisting and reusing cross-skill credentials is a broader account/session management behavior not conveyed by the manifest's description of simple link conversion.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This module is not just resolving runtime settings for conversion; it manages a reusable token in ~/.xhs-platform/config.json and documents that it is shared with a separate data-collection skill. For a skill whose stated purpose is converting XiaoHongShu note URLs, account credential persistence and interoperability with another skill are capabilities that are not clearly justified by the manifest alone.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The header comment specifies output conventions in Chinese, and later user-visible stderr/stdout messages are consistently hard-coded in Chinese. For an all-file-types policy check, this is a natural-language locale restriction because the file provides no opt-in, fallback, or justification for requiring Chinese.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The timeout path in pollTask attempts to instantiate BizError, but BizError is neither defined nor imported in this file. When a timeout occurs, the code will likely throw a ReferenceError instead of the expected structured business error, breaking the documented error-handling contract and potentially causing callers to mis-handle failures or lose the last task state needed for recovery.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The package description is written entirely in Chinese and labels the skill as a specific Chinese-language CLI without offering any language choice or noting that the skill is intentionally locale-specific. Under the natural-language policy rule, forcing a specific language or locale without opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

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