Back to skill

Security audit

Xiaohongshu Automation Suite

Security checks for vulnerabilities and agentic risk

Overview

This skill can use a saved Xiaohongshu login to publish posts and send replies automatically, with weak safeguards and anti-detection browser behavior.

Install only if you are comfortable giving the skill persistent access to your Xiaohongshu session and allowing automation that can post or reply from your account. Use a dedicated low-risk account, protect or rotate the cookie file, avoid unattended cron jobs, and require manual preview/approval before every publish or reply. Be especially cautious with the stealth mode and no-sandbox login helper.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
xiaohongshu-publish/publish_long_text.py:93
Finding
Publishing Proceeds Without the Documented Mandatory User Approval<![CDATA[ ## Vulnerability Details **File Location**: `xiaohongshu-publish/publish_long_text.py:93-98` **Related Requirement**: `xiaohongshu-publish/SKILL.md:42-48` **Vulnerability Type**: Missing authorization control for an irreversible external action **Risk Level**: High ### Vulnerable Code ```python print('🚀 发布...') page.locator('button:has-text("发布")').last.click() sleep(5) # 检查结果 current_url = page.url success = 'published=true' in current_url ``` The Skill documentation states that content must be reviewed by the account owner before publication, but the executable code does not implement that requirement. It clicks the publication button immediately after receiving the title and content. ### Technical Analysis Publishing content is an externally visible, account-authorized, and potentially irreversible operation. The function accepts content directly through arguments and does not provide: - An interactive confirmation immediately before publication. - A preview-only or dry-run mode. - An approval token or other out-of-band authorization. - Validation that the user has reviewed the final formatted content. - A distinction between preparing a draft and making it public. Documentation-level instructions are not a reliable security boundary. An Agent, automation workflow, or scheduled process can invoke this function directly and bypass the documented review requirement. ### Attack Path 1. An Agent workflow obtains untrusted, malformed, or attacker-influenced text. 2. The workflow passes the text through the `--title` and `--content` arguments. 3. The script loads authenticated Xiaohongshu cookies. 4. The script fills the title and content into the creator interface. 5. It clicks the final publication button without requesting user approval. 6. The content becomes publicly associated with the victim's account. ### Impact Assessment An attacker who can influence an Agent invocation or its content may cause unauthorized public posts. Potential ...[truncated 448 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Default to a preview or draft-only workflow. 2. Require explicit approval immediately before the final click, after showing the exact title and final content. 3. For non-interactive use, require a short-lived approval token tied to a hash of the exact content. 4. Separate content preparation from publication into different functions or commands. 5. Reject automated publication unless an explicit `--approved` option is supplied through a trusted control path. 6. Record the approved content hash, approval time, and resulting post URL in an audit log. 7. Add tests confirming that the publication button cannot be clicked without approval. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
xiaohongshu-reply/check_comments.py:163
Finding
Mutable Positional Indexes Can Send Replies to the Wrong Comment<![CDATA[ ## Vulnerability Details **File Location**: `xiaohongshu-reply/check_comments.py:163-183` **Additional Location**: `xiaohongshu-reply/reply_fixed.py:69-99` **Related Requirement**: `xiaohongshu-reply/SKILL.md:28-55` **Vulnerability Type**: Incorrect authorization target selection and unsafe automated messaging **Risk Level**: High ### Vulnerable Code From `xiaohongshu-reply/check_comments.py`: ```python # 回复指定的评论 for i, (comment_idx, reply_text) in enumerate(zip(comment_indices, replies)): if comment_idx <= len(reply_buttons): try: print(f"正在回复第 {comment_idx} 条评论...") # 点击回复按钮 reply_buttons[comment_idx - 1].click() # 索引从0开始 sleep(2) # 输入回复内容 textarea = page.locator('textarea').first textarea.fill(reply_text) sleep(1) # 点击发送 send_btn = page.get_by_text('发送', exact=True) send_btn.click() sleep(3) print(f"✅ 已回复第 {comment_idx} 条评论") except Exception as e: print(f"回复第 {comment_idx} 条评论失败: {e}") continue ``` From `xiaohongshu-reply/reply_fixed.py`: ```python # 回复所有 success_count = 0 for i in range(min(len(reply_buttons), len(replies))): try: print(f"📝 回复第 {i+1} 条: {replies[i][:20]}...") # 重新获取按钮(避免stale element) reply_buttons = page.get_by_text('回复', exact=True).all() if i >= len(reply_buttons): print("按钮数量变化,跳过") continue reply_buttons[i].scroll_into_view_if_needed() sleep(1) reply_buttons[i].click() sleep(2) # 输入回复 textarea = page.locator('textarea').first textarea.fill(replies[i]) sleep(1) # 点击发送 send_btn = page.get_by_text('发送', exact=True).first send_btn.click() sleep(3) pr ...[truncated 1994 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Bind each response to a stable comment ID, permalink, author ID, or verified unique content fingerprint. 2. Reload the notification page and re-identify the target immediately before every reply. 3. Verify multiple attributes, such as username, comment text, timestamp, and associated post. 4. Abort if matching is absent or ambiguous; never fall back to a positional index. 5. Require the user to approve the final target and reply text together. 6. Detect and reject placeholders such as `[reply content]` before enabling the send button. 7. Re-query the reply input and send button within the verified comment container instead of using the first global textarea or button. 8. Add concurrency tests that insert or remove comments between discovery and sending. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
login_helper.py:67
Finding
Authentication Cookies Are Persisted Without Explicit Restrictive Permissions<![CDATA[ ## Vulnerability Details **File Location**: `login_helper.py:67-74` **Vulnerability Type**: Insecure storage of bearer session credentials **Risk Level**: Medium ### Vulnerable Code ```python cookies = browser.cookies() simplified_cookies = {} for cookie in cookies: if '.xiaohongshu.com' in cookie['domain']: simplified_cookies[cookie['name']] = cookie['value'] with open(secret_path, 'w') as f: json.dump(simplified_cookies, f, indent=2) ``` ### Technical Analysis Xiaohongshu session and creator cookies are bearer credentials. Anyone who obtains valid values may be able to impersonate the account without knowing its password. The file is created with the process's default permission mask. The code does not: - Ensure that `~/.openclaw/secrets` is private. - Set the credential file to mode `0600`. - Validate ownership of the directory or destination. - Prevent symbolic-link replacement. - Write atomically. - Minimize which cookies are retained. The documentation warns users to protect cookies, but the implementation does not enforce secure local storage. ### Attack Path 1. A victim runs `login_helper.py` and completes login. 2. The helper gathers all cookies whose domain contains `.xiaohongshu.com`. 3. The cookies are written using inherited filesystem permissions. 4. On a permissively configured or shared system, another local user or process reads the file. 5. The attacker imports the cookies into a browser or automation context. 6. The attacker performs actions using the victim's authenticated Xiaohongshu session. A local attacker could also attempt a symlink attack if the destination or its parent directory is writable or improperly owned. ### Impact Assessment Successful credential theft may provide access to the victim's Xiaohongshu account at the privilege level represented by the captured cookies, potentially including: - Reading account notifications and comments. - Publishing content. - Replying to users. - Accessing ...[truncated 228 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create `~/.openclaw/secrets` with mode `0700` and verify that it is owned by the current user. 2. Create the cookie file with mode `0600`, independent of the process umask. 3. Reject symlinks and unexpected file types using `lstat`, `O_NOFOLLOW`, and ownership checks where supported. 4. Write to a securely created temporary file in the same directory, call `fsync`, and atomically replace the destination. 5. Retain only the minimum cookie names needed by each function. 6. Consider using the operating system credential store instead of plaintext JSON. 7. Provide a command to invalidate and securely remove stored sessions. 8. Avoid logging cookie values and ensure backup software does not collect the secrets directory unintentionally. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
stealth.min.js:7
Finding
Opaque Eval-Based Stealth Bundle Is Injected Into Authenticated Browser Sessions<![CDATA[ ## Vulnerability Details **File Location**: `stealth.min.js:7` **Loading Locations**: `login_helper.py:22-24`, `xiaohongshu-publish/publish_long_text.py:67-69`, `xiaohongshu-reply/check_comments.py:35-38` **Vulnerability Type**: Unverified dynamic code execution in an authenticated browser context **Risk Level**: Medium ### Vulnerable Code From `stealth.min.js`: ```javascript (({_utilsFns:_utilsFns,_mainFunction:_mainFunction,_args:_args})=>{ const utils=Object.fromEntries( Object.entries(_utilsFns).map(([key,value])=>[key,eval(value)]) ); utils.init(), eval(_mainFunction)(utils,..._args) }) ``` Representative loader from `xiaohongshu-publish/publish_long_text.py`: ```python browser = playwright.chromium.launch(headless=headless) context = browser.new_context() context.add_init_script(path=STEALTH_JS_PATH) context.add_cookies(cookies) ``` ### Technical Analysis The bundled stealth script reconstructs and executes JavaScript functions from strings using `eval`. This appears consistent with the documented `puppeteer-extra` stealth-evasion generation method, and the audit did not confirm any external payload download, executable download, or unrelated network endpoint inside the bundle. Nevertheless, the code is minified, dynamically evaluated, and loaded into browser contexts that later receive authenticated account cookies. There is no checksum, signature, source pin, or integrity verification before injection. The primary risk is therefore not confirmed malware in the reviewed copy. It is the high consequence of package tampering or unreviewed replacement: any altered JavaScript would automatically run in every new page before site scripts execute. ### Attack Path 1. An attacker compromises the distribution archive, installation directory, or update process. 2. The attacker replaces `stealth.min.js` with a modified bundle while retaining the expected filename. 3. The Python scripts call `add_init_script` without verifying its i ...[truncated 976 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the stealth component to an exact reviewed upstream commit and release. 2. Publish and verify a cryptographic hash before every load. 3. Keep auditable, unminified source and produce the minified bundle through a reproducible build. 4. Vendor the applicable license and exact provenance metadata. 5. Fail closed if integrity validation fails. 6. Restrict write permissions on the installed Skill directory. 7. Remove stealth injection from workflows where it is not essential. 8. Prefer narrowly scoped, reviewed compatibility patches over a large eval-based bundle. 9. Add automated checks that reject unexpected network primitives or changed bundle hashes. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
login_helper.py:13
Finding
Chromium Sandbox Is Disabled During Authenticated Login<![CDATA[ ## Vulnerability Details **File Location**: `login_helper.py:13-19` **Vulnerability Type**: Unnecessary reduction of browser process isolation **Risk Level**: Medium ### Vulnerable Code ```python browser = p.chromium.launch_persistent_context( user_data_dir, headless=False, args=[ '--no-sandbox', '--disable-setuid-sandbox', '--disable-blink-features=AutomationControlled' ] ) ``` ### Technical Analysis The `--no-sandbox` and `--disable-setuid-sandbox` arguments disable important Chromium process-isolation protections. These flags are not required for the declared desktop login functionality and violate least-privilege principles. The browser navigates to remote Xiaohongshu content and maintains a persistent profile. If the browser engine, a loaded page, or third-party page content is compromised, disabling sandboxing makes it easier for malicious code to affect the host operating system. This finding does not establish that Xiaohongshu serves malicious content or that a working browser exploit exists. It identifies an unnecessary defense-in-depth removal that increases the consequence of such an exploit. ### Attack Path 1. The user launches the login helper. 2. Chromium starts with its sandbox protections disabled. 3. The browser loads remote login-page resources. 4. A malicious resource or compromised page exploits a Chromium vulnerability. 5. Because sandbox isolation is disabled, the exploit has a less restricted path to the privileges of the Python process and local user. 6. Host files and other user-accessible resources may become exposed. ### Impact Assessment The maximum impact depends on the underlying browser exploit and the privileges of the user running the Skill. Potential scope includes: - Access to files available to the local user. - Theft of the persistent browser profile and account sessions. - Modification of Skill files and stored secrets. - Execution of commands with the current use ...[truncated 160 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `--no-sandbox` and `--disable-setuid-sandbox`. 2. Confirm that supported Playwright environments run successfully with Chromium's default sandbox. 3. If sandbox disabling is unavoidable in a specific deployment, run the entire browser inside a dedicated, unprivileged container or virtual machine. 4. Do not mount unrelated host secrets or writable host directories into that environment. 5. Use a dedicated low-privilege operating-system account for browser automation. 6. Keep Chromium and Playwright patched and version-pinned. 7. Restrict the persistent profile directory to the automation account with mode `0700`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Using local authentication cookies from a secrets path without disclosing that access in the skill description is a real security concern. Hidden reliance on existing session material can cause silent authenticated actions under the user's account and weakens informed consent and security review.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Using local authentication cookies from a secrets path without disclosing that access in the skill description is a real security concern. Hidden reliance on existing session material can cause silent authenticated actions under the user's account and weakens informed consent and security review.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Using local authentication cookies from a secrets path without disclosing that access in the skill description is a real security concern. Hidden reliance on existing session material can cause silent authenticated actions under the user's account and weakens informed consent and security review.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Using local authentication cookies from a secrets path without disclosing that access in the skill description is a real security concern. Hidden reliance on existing session material can cause silent authenticated actions under the user's account and weakens informed consent and security review.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Using local authentication cookies from a secrets path without disclosing that access in the skill description is a real security concern. Hidden reliance on existing session material can cause silent authenticated actions under the user's account and weakens informed consent and security review.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The documentation promotes automatic publishing and comment replies, and even suggests cron-based unattended automation, without consistently emphasizing account, moderation, impersonation, and content-risk consequences. In an AI-agent skill, weak warnings and guardrails can lead users to enable unsupervised actions that damage accounts, spam others, or publish unintended content at scale.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The README explicitly documents bundled stealth and anti-detection capabilities for bypassing browser automation detection, including hiding navigator.webdriver and spoofing browser fingerprints. In the context of account automation for posting and replying on a third-party platform, this meaningfully increases abuse potential and facilitates evasion of platform safeguards, making the skill more dangerous than ordinary automation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding
The skill advertises executable Python tooling that can read/write local files and access the network, but the manifest declares no explicit tool scope or permission boundaries. In an automation skill that performs login, cookie handling, publishing, and comment actions, missing scope declarations reduces reviewability and increases the chance of unintended or over-privileged execution.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill encourages automated publishing and comment replies without clearly warning users that it will perform live actions on their behalf using their authenticated account. In this context, silent or poorly signposted automation increases the risk of accidental spam, policy violations, reputational harm, or unintended interactions with third parties.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill openly promotes cookie capture and persistence but does not warn that cookies are sensitive authentication tokens that may grant full account access if stolen or mishandled. In the context of a social-media automation skill, persistent cookies can enable unauthorized posting, replying, or account takeover-like abuse without reauthentication.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The document explicitly instructs users to load a stealth script whose purpose is to bypass anti-bot and fingerprinting checks by modifying browser-exposed properties such as navigator.webdriver, window.chrome, plugins, permissions, and WebGL metadata. In the context of an automation suite for Xiaohongshu with 'stealth login helpers', this meaningfully enables evasion of platform detection and undermines site integrity, while the documentation provides only generic legal caveats rather than clear security, abuse, and consent warnings.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script captures authenticated Xiaohongshu session cookies from a persistent browser context and writes them to a local JSON secrets file without any explicit user consent prompt, warning, or protective controls. Session cookies are bearer credentials; anyone who can read that file may be able to hijack the account session, and the skill context makes this more dangerous because it is explicitly designed for stealth login automation and credential persistence.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
This file deliberately modifies many browser fingerprinting and automation-detection surfaces, including navigator.webdriver, plugins, languages, WebGL, permissions, chrome.runtime, media capabilities, window dimensions, and iframe behavior. In the context of a social-platform automation skill with 'stealth login helpers', that goes beyond simple compatibility work and is specifically designed to evade bot detection and conceal automation, which increases abuse potential and can violate platform security controls.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script performs stealth spoofing and sanitizes proxy-related error stacks to hide evidence of instrumentation, while providing no in-code warning, consent, or disclosure. In this skill's context, the lack of transparency makes the evasion harder to audit and easier to repurpose for deceptive automation against Xiaohongshu or similar platforms.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The code sets `navigator.languages` to `['en-US', 'en']` whenever `opts.languages` is empty, which imposes a specific language/locale without user opt-in. This is a natural-language policy concern because it overrides locale signaling rather than preserving user choice or documenting a justified regional constraint.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The file presents all user-facing instructions and operational guidance exclusively in Chinese, and does not indicate that the user can choose another language or opt in to this locale. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless clearly justified as region-specific.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script silently loads live authentication cookies from a fixed secrets path and uses them to authenticate browser automation. In an automation skill focused on stealth login and publishing, this creates meaningful risk of unintended account use or abuse because anyone invoking the script can act as the account owner without an explicit confirmation step or credential-use warning.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script performs a real network-backed publish operation using stored authenticated cookies, but the CLI flow does not clearly warn the user that content will be submitted live to Xiaohongshu. In the context of a social-media automation suite with stealth helpers, this increases the chance of accidental or deceptive posting from a real account.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill explicitly instructs the agent to load authentication cookies from a local secrets file (`~/.openclaw/secrets/xiaohongshu.json`) and use them to access a live Xiaohongshu account. Even though this is functionally necessary for automation, it involves handling sensitive credentials without an explicit warning, consent step, scope restriction, or guidance on secure storage/rotation, which increases the risk of unauthorized account access or accidental credential exposure.

Context-Inappropriate Capability

Medium
Confidence
83% confidence
Finding
The manifest describes Xiaohongshu automation including comment management and stealth login helpers, but this file's documented purpose is viewing and replying to comments. Instead of using an explicit login flow, it accesses a local secrets file containing cookies, which is credential access beyond what comment viewing/replying itself requires and is not indicated in this file's stated intent.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The function accesses a sensitive cookie file under ~/.openclaw/secrets and uses those credentials to authenticate browser actions on the user's behalf. The code lacks an explicit warning that stored credentials will be read and used, beyond a missing-file error message.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The function writes raw extracted comment content to a local plaintext file without notice, consent, or retention controls. This can expose private user interactions, usernames, and message content to other local users, backups, or later misuse, especially since the file is created automatically during routine comment retrieval.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This function reads authentication cookies, opens the Xiaohongshu notification page, fills reply text, and clicks the send button to post responses. While the main block asks for confirmation in one execution path, the function itself contains no built-in disclosure or confirmation and could be called programmatically without warning before performing account actions.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script reads authentication cookies from a local secrets file and immediately uses them to create an authenticated browser session, with no consent prompt, validation, or scope limitation. In an automation skill specifically designed for stealth login and comment management, this increases the risk of silent account takeover behavior, accidental misuse of a privileged session, or unauthorized actions if the script is run in the wrong context.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script automatically clicks the send button and posts replies without any final review, confirmation, or per-message authorization. Because this skill is for social-media automation, that behavior can directly cause unwanted public posts, spam-like activity, account enforcement, or reputational harm if the reply targets or content are incorrect.