Back to skill

Security audit

XHS Auto-Publish

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-built for Xiaohongshu posting, but it can publish through a logged-in browser by default despite contradictory safety instructions.

Review this carefully before installing. Use only with a browser profile and Xiaohongshu account you intend to post from, prefer --dry-run for previews, and do not pass untrusted body, hashtag, or body-file content. The publisher should make publishing explicit with --publish plus confirmation and should insert editor text safely instead of using unsanitized innerHTML.

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
publish.js:222
Finding

Unescaped HTML Injection into an Authenticated Browser Page

Content
View full analysis
`

${line || ''}

`).join(''); const bodySet = await page.evaluate((html) => { const el = document.querySelector('[contenteditable="true"]'); if (!el) return false; el.innerHTML = html; el.dispatchEvent(new Event('input', { bubbles: true })); return true; }, bodyHtml); ``` ### Technical Analysis The post body and hashtags originate from command-line arguments or a user-selected body file. These values are interpolated directly into HTML markup and assigned to the editor's `innerHTML` property without escaping or sanitization. An attacker able to influence the body or hashtag content can inject arbitrary HTML elements and attributes. Although scripts inserted directly through `innerHTML` are generally not executed as ordinary script elements, active attributes and elements—such as event-handler attributes—may execute when their associated events occur. The injection happens inside an already authenticated Xiaohongshu Creator page. Consequently, executable injected content would run in the context of that page rather than in an isolated preview document. ### Attack Path 1. An attacker supplies or persuades a user to use a malicious `--body`, `--body-file`, or `--hashtags` value. 2. The script appends the attacker-controlled content to `fullBody`. 3. Line 222 embeds the content into paragraph markup without HTML escaping. 4. Lines 226-229 assign the resulting markup to the authenticated page using `innerHTML`. 5. If the injected markup includes an active element or event-handler attribute and the relevant event is triggered, attacker-controlled JavaScript may execute in the page context. 6. That code may interact with the authenticated creator interface and initiate requests pe ...[truncated 850 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
publish.js:9
Finding

Default Automatic Publication Contradicts the Documented Explicit-Publish Safety Model

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description understates materially risky behavior: the workflow defaults to live publication and also captures screenshots, while the description frames the skill as generic automation support. This is dangerous because operators may invoke the skill expecting drafting or preview assistance, but it can perform irreversible real-world actions and save potentially sensitive content without fully informed consent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation explicitly states the script will not publish unless a --publish flag is set, but the implementation defaults publish to true and only disables it with --dry-run. This mismatch is dangerous because operators may rely on the documented safety behavior and unintentionally trigger a real post to an authenticated Xiaohongshu account.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes environment-derived behavior (XHS_CDP_URL) and browser automation capabilities but does not declare any tool scope or permissions boundaries. This is dangerous because it obscures what external resources and local execution context the skill depends on, making review and policy enforcement harder and increasing the chance that an agent can access unintended local/browser state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Publishing by default creates a real external side effect on a logged-in social-media account without a strong warning or explicit opt-in. In this skill's context, CDP control over an already authenticated browser makes the risk more acute because a mistaken or malicious invocation can immediately publish content to a real audience, causing reputational, compliance, or business harm.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script performs a destructive external action against a live social media account by default, with no interactive confirmation, preview approval, or secondary safety check before clicking 发布. In this skill context, the browser session is already logged in, so a single mistaken invocation can immediately publish unintended content to a public brand or personal account.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency uses a caret range (^1.50.0), which permits automatic installation of newer compatible versions rather than a single fixed release. This increases supply-chain risk because builds may silently change over time, and a compromised or regressed upstream release of playwright-core could affect this browser-automation skill without code changes in the repository.

Content

Scanner excerpt · package.json (reported line 7)May include surrounding context.

json
"description": "Xiaohongshu (小红书) auto-publish via browser CDP automation",
  "private": true,
  "dependencies": {
    "playwright-core": "^1.50.0"
  }
}

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file is explicitly targeted at Xiaohongshu and uses Chinese-only titles, help examples, selectors, and button text such as 上传图文 and 发布. This imposes a specific language/locale behavior without opt-in or documented language selection, which matches the stated policy concern for forced locale behavior.

Content

No source excerpt is available for this finding.