Back to skill

Security audit

XHS_Content productionandpublishing

Security checks for vulnerabilities and agentic risk

Overview

This skill openly automates Xiaohongshu posting, but it can publish to a live account without a final confirmation and stores authenticated-page diagnostics locally.

Install only if you intend to let the skill post to your Xiaohongshu account. Review generated title, text, and images before running the publish command, keep the browser profile directory private, and periodically delete saved profiles, screenshots, generated content, and HTML debug dumps from the skill data directory.

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

Warning
Location
scripts/publish.py:17
Finding
Authenticated Browser Data Persisted in Unprotected Diagnostic Files## Vulnerability Details **File Location**: `scripts/publish.py:17-26, 83-85, 296-301, 327-332` **Vulnerability Type**: Plaintext storage of sensitive authenticated page data **Risk Level**: Medium ### Vulnerable Code ```python # Screenshot directory SCREENSHOT_DIR = get_subdir("screenshots") ``` ```python def save_shot(page, name: str) -> str: """Save screenshot""" timestamp = time.strftime("%Y%m%d_%H%M%S") path = SCREENSHOT_DIR / f"{timestamp}_{name}.png" page.screenshot(path=str(path)) print(f"[Screenshot] {path}") return str(path) ``` ```python page.goto("https://creator.xiaohongshu.com/publish/publish", timeout=30000) page.wait_for_timeout(3000) save_shot(page, "01_landing") ``` ```python if not editor_ready: save_shot(page, "03c_editor_not_ready") # Dump HTML for debugging try: html = page.content() debug_path = SCREENSHOT_DIR / f"{time.strftime('%Y%m%d_%H%M%S')}_page_debug.html" debug_path.write_text(html, encoding="utf-8") print(f"[Debug] Page HTML saved to: {debug_path}") except Exception: pass ``` ```python if not editor_found: print("[ERROR] Content editor not found!") save_shot(page, "04_editor_not_found") # Dump page HTML for debugging try: html = page.content() debug_path = SCREENSHOT_DIR / f"{time.strftime('%Y%m%d_%H%M%S')}_page_debug.html" debug_path.write_text(html, encoding="utf-8") print(f"[Debug] Page HTML saved to: {debug_path}") except Exception: pass raise Exception("Content editor not found") ``` ### Technical Analysis The publishing workflow runs inside an authenticated Xiaohongshu creator session. It automatically captures screenshots at multiple stages and writes the complete authenticated page DOM to disk when editor detection fails. These diagnostic artifacts may contain account identifiers, unpublished post content, uploaded media previews, creator-page state, or other private info ...[truncated 1965 chars]
Remediation
## Remediation Suggestions 1. Make all screenshots and HTML dumps opt-in through an explicit option such as `--debug`. 2. Disable full authenticated DOM dumps by default. Prefer narrowly scoped diagnostic metadata, such as selector states and sanitized error messages. 3. Redact account identifiers, post text, image previews, tokens, URLs containing sensitive parameters, and hidden fields before saving diagnostics. 4. Create diagnostic directories and files with owner-only permissions, such as `0700` for directories and `0600` for files where supported. 5. Add retention controls and automatically delete diagnostics after a short configurable period. 6. Warn users before capturing authenticated content and clearly identify the storage location. 7. Ensure `.local/`, browser profiles, screenshots, and HTML dumps are excluded from version control, cloud synchronization, and routine backups where appropriate. 8. Provide a cleanup command that securely removes retained screenshots, DOM dumps, and temporary browser data. 9. Separate routine operational screenshots from failure diagnostics and avoid capturing pages unless the image is necessary to diagnose a specific error.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill performs sensitive actions involving environment variables and file writes, but the manifest does not declare any tool scope or permissions boundary. This makes the automation's effective capabilities opaque to users and hosting systems, increasing the chance of unintended access to local data or filesystem locations during execution.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This skill automates publishing to a real Xiaohongshu creator account, but the description does not prominently warn that running it can post live content on the user's behalf. In an agent ecosystem, lack of an explicit high-visibility warning can lead to accidental unauthorized posting, reputational damage, or policy violations if invoked without fully informed consent.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The documentation describes persistent browser profile usage for saved login state, but does not clearly warn that authentication artifacts may remain on disk and could be reused by anyone with local access. Because this skill targets a live social-media account, stolen or reused profile data could enable unauthorized posting or account takeover within the browser context.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The module docstring, CLI description, and all argument help text are written only in Chinese, indicating a fixed language/locale experience. Under the policy rule, forcing a specific language without offering a choice or documenting a justified region-specific constraint is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This code file contains natural-language strings that assume Chinese-language output and audience, including the module description and all generated templates. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly justified or optional.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
This code file contains natural-language descriptions and generated text entirely in Chinese, including the stated style and fallback/output text, with no indication that users can choose another language or locale. That creates a language/locale policy concern because the skill effectively forces a specific language experience by default.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The code directly clicks the final '发布' button and completes the post flow without any explicit user-facing confirmation, dry-run mode, or policy gate at the point of no return. In a skill whose purpose is automated social-media publishing, this is operationally risky because any upstream prompt injection, bad content generation, account mix-up, or unintended invocation can result in real public posting under the user's authenticated account.

Static analysis

No suspicious patterns detected.