← MCP server and skill grades

xiaohongshu-skill

DeliciousBuding/xiaohongshu-skill

C
Type
Skill
Scanned
Nov 17, 2026
Version
0bd4ce400201
Files read
99

This project is an AI agent skill and Python CLI that uses Playwright Chromium to search, read, publish posts, and interact on your Xiaohongshu (RedNote) account. The biggest risk is that untrusted text read by the agent can trick it into dumping your live session cookies or overwriting and deleting arbitrary local files via the unrestricted --cookie flag, or loading internal network resources when rendering Markdown into images.

What it can reach

Browser
Controls a persistent Chromium browser logged into your Xiaohongshu and Creator Center accounts to read feeds, profiles, and comments, and to publish notes, comments, replies, likes, and collections.
Secrets
Stores, reads, and deletes Xiaohongshu session cookies, persistent browser storage, and session fingerprint metadata under ~/.xiaohongshu/, plus login QR images under data/qrcode.png.
Files
Reads local images, videos, and Markdown files for publishing, writes rendered Markdown screenshots and ~/.xiaohongshu/strategy.json, and writes or deletes files at paths passed via --cookie.
Network
Connects to www.xiaohongshu.com and creator.xiaohongshu.com during automation, and fetches any URL embedded in Markdown or HTML passed to publish-md.

Findings

1 high1 medium1 low
  1. HighUnrestricted --cookie flag exports live session cookies to arbitrary files and allows arbitrary file deletion

    scripts/client.py:335

    While --profile strictly validates names to prevent path traversal outside ~/.xiaohongshu/, the undocumented global --cookie (-c) flag in scripts/__main__.py accepts any filesystem path without validation while leaving user_data_dir pointed at the active persistent browser profile (~/.xiaohongshu/browser-data). When a prompt-injected agent passes --cookie to even a read-only command such as check-login or search, XiaohongshuClient loads the authenticated browser profile, creates session.json in the target directory, and on close writes all live session cookies to cookie_path, exposing credentials inside workspace-readable folders or overwriting existing user files. Passing --cookie to logout also reaches os.remove(path) in scripts/login.py, deleting any user-writable file on disk.

    Fix: Remove the undocumented --cookie CLI flag in favor of --profile, or confine cookie_path within ~/.xiaohongshu/ and never pair a custom cookie path with the default persistent user_data_dir.

  2. MediumMarkdown-to-image renderer executes raw HTML and JavaScript and fetches arbitrary URLs

    scripts/publish.py:1303

    In publish-md, md_to_images converts Markdown with Python-Markdown (which passes raw HTML tags such as script, iframe, and img through unsanitized) and loads the resulting HTML into headless Chromium via page.set_content with JavaScript and network access enabled until networkidle. If the agent renders untrusted Markdown or is prompt-injected via --text or --file, embedded scripts or iframes can make requests to localhost or internal network services (SSRF) and render internal web pages directly into the screenshots uploaded to Xiaohongshu.

    Fix: Sanitize rendered HTML to strip scripts, iframes, and external subresources, create the Playwright page with java_script_enabled=False, and abort all network requests using page.route.

  3. LowPersistent browser directories and login QR images are created with permissive default permissions

    scripts/client.py:251

    Although session_store.py sets 0600 permissions on cookies.json and session.json, ~/.xiaohongshu and browser-data are created with os.makedirs using the default process umask (typically 0755 on Linux and macOS), leaving Chromium storage subdirectories such as Local Storage readable to other local users on a shared machine. In addition, scripts/login.py writes data/qrcode.png (or a fallback full-page screenshot) with default permissions and leaves it on disk after login finishes or times out.

    Fix: Create and chmod ~/.xiaohongshu and browser-data directories with mode 0o700, write login QR screenshots with mode 0o600 inside ~/.xiaohongshu, and delete the QR image once login completes or expires.