Back to skill

Security audit

Xhs

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Xiaohongshu automation helper, but it asks users to install and persist an unverified third-party service with account access and stores session cookies unsafely.

Install only if you are comfortable with a third-party Xiaohongshu MCP binary controlling an authenticated account from your machine. Prefer a pinned and checksum-verified release, run it as an unprivileged user or container, avoid the systemd root service, do not paste raw browser cookies unless you understand they can act like passwords, and confirm every publish/comment/like/favorite action before execution.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:484
Finding

Mutable and Unverified Remote Binary Is Downloaded and Executed

Content
View full analysis
mcp.log 2>&1 & ``` ### Technical Analysis The installation instructions retrieve an executable archive from the mutable `latest` release of a third-party GitHub repository. The archive is extracted, its files are made executable using a wildcard, and the resulting binary is launched. No immutable release version, hard-coded cryptographic checksum, release signature, or trusted-key verification is used. Consequently, the executable installed by the Skill can change after the Skill itself has been reviewed. Compromise of the repository, release account, build pipeline, or release artifact would translate directly into arbitrary local code execution. The wildcard command `chmod +x xiaohongshu-*` also grants executable permissions to every matching extracted file rather than only to explicitly expected binaries. ### Attack Path 1. An attacker compromises the upstream repository owner, release workflow, or GitHub credentials. 2. The attacker replaces the artifact associated with the mutable `latest` release. 3. A user follows the Skill's installation instructions. 4. `wget` retrieves the attacker-controlled archive without integrity verification. 5. The archive is extracted and matching files are marked executable. 6. The malicious binary is started through `nohup` or systemd. 7. The payload e ...[truncated 561 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:497
Finding

Downloaded MCP Binary Is Registered as a Persistent System-Wide Service

Content
View full analysis
/etc/systemd/system/xhs-mcp.service << 'EOF' [Unit] Description=Xiaohongshu MCP Service After=network.target xvfb.service Requires=xvfb.service [Service] Environment=DISPLAY=:99 WorkingDirectory=/root/xiaohongshu-mcp ExecStart=/root/xiaohongshu-mcp/xiaohongshu-mcp-linux-amd64 Restart=always RestartSec=5 [Install] WantedBy=multi-user.target EOF sudo systemctl daemon-reload sudo systemctl enable xhs-mcp && sudo systemctl start xhs-mcp systemctl status xhs-mcp ``` A second persistent service is also recommended for Xvfb: ```bash sudo systemctl enable xvfb && sudo systemctl start xvfb ``` ### Technical Analysis The Skill instructs the agent to write a unit into `/etc/systemd/system`, enable it at boot, and configure automatic restarts. This turns a downloaded third-party binary into a cross-session, system-wide persistent service. The MCP service omits `User=` and `Group=` directives. A system service therefore runs as root by default. It also lacks common systemd sandboxing controls such as `NoNewPrivileges`, `ProtectSystem`, `ProtectHome`, `PrivateTmp`, capability restrictions, and syscall filtering. Persistent service registration is not the minimum privilege necessary for the declared functionality. Content generation requires no service at all, while platform operations can use an explicitly started user process for the duration of the requested operation. ### Attack Path 1. The remote MCP artifact is compromised or otherwise contains hostile functionality. 2. The user follows the installation instructions with administrative privileges. 3. The Skill writes the service definition into `/etc/systemd/system`. 4. `systemctl enable` creates boot-time activation links. 5. systemd starts the downloaded binary as root. 6. `Restart=always` relaunches it after ...[truncated 752 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:382
Finding

Authentication Cookies Are Stored in Plaintext Without Enforced File Permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate.sh:22
Finding

User-Configurable API Endpoint Receives Bearer Credentials and Private Content Without Destination Validation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (50)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

描述强调的是面向用户的小红书业务功能集合,而代码片段本身并未实现这些核心功能,只是在为相关 MCP 服务做本地环境准备和健康检查。这种差异部分可视为支撑性实现细节,但存在一处明显的实质性不一致:描述声称封面图“纯ImageMagick生成,无需API配置”,而脚本专门检查并要求配置 Gemini/OpenAI/Hunyuan 图像生成 API,否则提示封面生成功能不可用。因此,至少在封面生成实现方式上,代码行为与声明明显冲突;同时,该片段的直接目的更偏向运维/初始化,而非所宣称的内容创作与平台操作。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description claims a broad Xiaohongshu assistant that supports end-to-end operations including writing notes, generating copy/titles/covers, publishing, searching, and interacting with posts. However, the provided code chunk only implements one narrow function: local cover image generation via ImageMagick. It does not connect to Xiaohongshu, perform network actions, publish content, search, manage posts, or execute engagement operations. It also does not generate textual copy; it only lays out supplied title text onto an image. While cover generation is consistent with part of the declared description, the actual code is materially narrower than the declared primary purpose, so the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个覆盖创作、封面、发布和站内交互的全功能小红书助手;但给出的代码片段只实现了“生成标题/正文”这一小部分能力,而且还是通过用户提供的外部 AI API 调用完成。代码没有任何与小红书平台交互的逻辑,也没有封面图生成或 ImageMagick 使用痕迹。因此,代码实际行为明显窄于且不同于声明用途,属于实质性描述不符。

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description uses very broad triggers such as any Xiaohongshu-related request, which can cause over-invocation of a shell-capable automation skill. In practice, loose activation increases the chance that routine conversation is escalated into account actions, local command execution, or data transmission without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manual cookie-login flow instructs users to paste live browser cookies and writes them to disk without strong warnings, minimization, or protection guidance. Session cookies are authentication secrets; exposing or mishandling them can enable full account takeover and cross-session abuse.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · SKILL.md (reported line 451)May include surrounding context.

bash
# Ubuntu/Debian
sudo apt update && sudo apt install -y xvfb imagemagick zbar-tools xdotool fonts-noto-cjk

# CentOS/RHEL
sudo yum install -y xorg-x11-server-Xvfb ImageMagick zbar xdotool

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · SKILL.md (reported line 477)May include surrounding context.

bash
# Ubuntu/Debian
sudo apt update && sudo apt install -y xvfb imagemagick zbar-tools xdotool fonts-noto-cjk

# CentOS/RHEL
sudo yum install -y xorg-x11-server-Xvfb ImageMagick zbar xdotool

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · SKILL.md (reported line 517)May include surrounding context.

bash
# Ubuntu/Debian
sudo apt update && sudo apt install -y xvfb imagemagick zbar-tools xdotool fonts-noto-cjk

# CentOS/RHEL
sudo yum install -y xorg-x11-server-Xvfb ImageMagick zbar xdotool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/generate.sh (reported line 83)May include surrounding context.

sh
)

  echo "🔄 正在生成小红书爆款标题..."
  RESULT=$(curl -s -X POST "$API_URL" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $API_KEY" \
    -d "$PAYLOAD")

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/generate.sh (reported line 126)May include surrounding context.

sh
)

  echo "🔄 正在生成小红书正文..."
  RESULT=$(curl -s -X POST "$API_URL" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $API_KEY" \
    -d "$PAYLOAD")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
97% confidence
Finding

The skill invokes extensive shell capabilities but declares no explicit tool scope or allowed-tools restrictions. That means a broad natural-language trigger can cause host command execution, package installation, service management, and network calls without manifest-level least-privilege boundaries.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

The skill sends requests to an MCP endpoint over HTTP and allows the endpoint to be overridden via environment variable. Even though the default is localhost, the configurable URL and the lack of transport/authentication assurances can expose prompts, session identifiers, and action parameters to unintended services if misconfigured.

Content

Scanner excerpt · SKILL.md (reported line 123)May include surrounding context.

md
MCP_URL="${XHS_MCP_URL:-http://localhost:18060/mcp}"

# 初始化并获取 Session ID
SESSION_ID=$(curl -s -D /tmp/xhs_headers -X POST "$MCP_URL" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"openclaw","version":"1.0"}},"id":1}' > /dev/null && grep -i 'Mcp-Session-Id' /tmp/xhs_headers | tr -d '\r' | awk '{print $2}')

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

This initialization-confirmation request is part of the same external communication pattern and inherits the same risk: data and session context are transmitted to a service identified only by a runtime URL. If the endpoint is redirected or compromised, the skill can disclose operational context and enable unauthorized tool execution.

Content

Scanner excerpt · SKILL.md (reported line 128)May include surrounding context.

md
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"openclaw","version":"1.0"}},"id":1}' > /dev/null && grep -i 'Mcp-Session-Id' /tmp/xhs_headers | tr -d '\r' | awk '{print $2}')

# 确认初始化
curl -s -X POST "$MCP_URL" \
  -H "Content-Type: application/json" \
  -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' > /dev/null

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Several trigger phrases overlap with ordinary language, making it easier for the skill to perform actions like likes, favorites, searches, and comments based on ambiguous prompts. Because these actions affect a real account and external platform state, accidental invocation has meaningful security and integrity consequences.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The search example demonstrates outbound transmission of user-supplied keywords and session state to the MCP service. In context, the danger is moderate because the data may be sensitive and the skill provides no clear safeguards against endpoint substitution, logging leakage, or unintended forwarding.

Content

Scanner excerpt · SKILL.md (reported line 244)May include surrounding context.

md
SESSION_ID=$(curl -s -D /tmp/xhs_headers -X POST "$MCP_URL" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"openclaw","version":"1.0"}},"id":1}' > /dev/null && grep -i 'Mcp-Session-Id' /tmp/xhs_headers | tr -d '\r' | awk '{print $2}')
curl -s -X POST "$MCP_URL" -H "Content-Type: application/json" -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' > /dev/null
curl -s -X POST "$MCP_URL" -H "Content-Type: application/json" -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"search_feeds","arguments":{"keyword":"美食探店"}},"id":2}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The publish example transmits full post content, image paths, and tags to a service that can perform account actions. Because publishing changes external state and may disclose local file paths and authored content, misrouting or compromise of the endpoint could result in unauthorized posting or leakage of user data.

Content

Scanner excerpt · SKILL.md (reported line 256)May include surrounding context.

md
SESSION_ID=$(curl -s -D /tmp/xhs_headers -X POST "$MCP_URL" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"openclaw","version":"1.0"}},"id":1}' > /dev/null && grep -i 'Mcp-Session-Id' /tmp/xhs_headers | tr -d '\r' | awk '{print $2}')
curl -s -X POST "$MCP_URL" -H "Content-Type: application/json" -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' > /dev/null
curl -s -X POST "$MCP_URL" -H "Content-Type: application/json" -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"publish_content","arguments":{"title":"新加坡私立大学留学指南","content":"分享新加坡私立大学的申请流程和注意事项,包括学校选择、申请材料准备、签证办理等实用信息。","images":["/path/to/image1.jpg","/path/to/image2.jpg"],"tags":["新加坡留学","新加坡私立大学","留学申请","国际教育","海外学习"]}},"id":2}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The QR-code retrieval flow sends authentication-related requests to the MCP service and receives login material derived from a live session. If the service or path is untrusted, login artifacts and session setup can be intercepted or abused.

Content

Scanner excerpt · SKILL.md (reported line 286)May include surrounding context.

md
SESSION_ID=$(curl -s -D /tmp/xhs_headers -X POST "$MCP_URL" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"openclaw","version":"1.0"}},"id":1}' > /dev/null && grep -i 'Mcp-Session-Id' /tmp/xhs_headers | tr -d '\r' | awk '{print $2}')
curl -s -X POST "$MCP_URL" -H "Content-Type: application/json" -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' > /dev/null
curl -s -X POST "$MCP_URL" -H "Content-Type: application/json" -H "Mcp-Session-Id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_login_qrcode","arguments":{}},"id":2}'

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs GUI screenshot capture and desktop input automation, including typing verification codes into a login window. That gives the agent the ability to manipulate interactive sessions and sensitive authentication flows, which is far broader and riskier than simple Xiaohongshu assistance.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

The instruction that GUI processes must use nohup indicates intentional background persistence beyond the interactive command lifetime. While not inherently malicious, it allows unattended processes to continue operating after the conversation step completes.

Content

Scanner excerpt · SKILL.md (reported line 315)May include surrounding context.

步骤 1: 启动登录工具

所有命令必须用 nohup 后台运行,否则会因超时被中断。

bash
pkill -f xiaohongshu-login 2>/dev/null

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

Background-starting the login binary with nohup leaves an interactive authentication-related process running after the initiating step. That can expose the session to later manipulation or stale GUI artifacts, particularly because the skill also automates screenshots and input.

Content

Scanner excerpt · SKILL.md (reported line 320)May include surrounding context.

bash
pkill -f xiaohongshu-login 2>/dev/null
sleep 1
cd ~/xiaohongshu-mcp && DISPLAY=:99 nohup ./xiaohongshu-login-linux-amd64 > login.log 2>&1 &
sleep 5

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

Background-starting the MCP service with nohup creates an unsupervised persistent component that can perform authenticated actions later. Because this service is tied to account operations, persistence increases the window for unintended or unauthorized use.

Content

Scanner excerpt · SKILL.md (reported line 359)May include surrounding context.

cat ~/xiaohongshu-mcp/login.log | tail -5

如果显示 "Login successful":

pkill -f xiaohongshu 2>/dev/null cd ~/xiaohongshu-mcp && DISPLAY=:99 nohup ./xiaohongshu-mcp-linux-amd64 > mcp.log 2>&1 &

text

#### 二维码过期

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

Restarting the MCP service in the background after cookie import leaves a long-lived authenticated process active. Combined with on-disk cookie storage, this increases both persistence and account-compromise risk.

Content

Scanner excerpt · SKILL.md (reported line 421)May include surrounding context.

bash
pkill -f xiaohongshu-mcp-linux 2>/dev/null
sleep 1
cd ~/xiaohongshu-mcp && DISPLAY=:99 nohup ./xiaohongshu-mcp-linux-amd64 > mcp.log 2>&1 &
sleep 3

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill includes host-level package installation, service creation, systemd enablement, and persistent daemon setup, which exceed the normal scope of a social-media assistant. In an agent setting, this materially expands blast radius from content assistance to full local system modification and persistence.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
96% confidence
Finding

The skill instructs execution of sudo package-installation commands, expanding its capabilities to privileged host modification. In a conversational agent context, privilege escalation from a content assistant to root-level system changes is highly risky and can be abused to alter the system far beyond the user’s likely expectations.

Content

Scanner excerpt · SKILL.md (reported line 451)May include surrounding context.

bash
# Ubuntu/Debian
sudo apt update && sudo apt install -y xvfb imagemagick zbar-tools xdotool fonts-noto-cjk

# CentOS/RHEL
sudo yum install -y xorg-x11-server-Xvfb ImageMagick zbar xdotool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
95% confidence
Finding

This second sudo installation path for another distro has the same security issue: the skill can direct privileged package changes on the host. Such cross-platform privileged instructions make accidental or excessive system modification more likely.

Content

Scanner excerpt · SKILL.md (reported line 454)May include surrounding context.

sudo apt update && sudo apt install -y xvfb imagemagick zbar-tools xdotool fonts-noto-cjk

CentOS/RHEL

sudo yum install -y xorg-x11-server-Xvfb ImageMagick zbar xdotool

text

### 启动虚拟显示