Back to skill

Security audit

小红书自动互动技能

Security checks for vulnerabilities and agentic risk

Overview

The skill openly automates Xiaohongshu likes and favorites, but it normalizes unattended recurring account actions through cron without enough scoping, confirmation, or disable guidance.

Install only if you intentionally want automated Xiaohongshu engagement under your logged-in account. Prefer manual runs or a dry-run/review step, avoid the provided cron schedule unless you understand it will keep running, review and protect the workspace script path, remove any cron entry when no longer needed, and periodically clear or inspect the log and history files.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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 (2)

T06 · System Persistence

Error
Location
SKILL.md:34
Finding

Recurring Cron Task Enables Unattended Cross-Session Execution

Content
View full analysis
> /home/chan/.openclaw/workspace/xhs_interaction.log 2>&1" fi ``` ### Technical Analysis The documented installation process instructs the user to create a cron entry that survives the current Skill invocation and executes an account-interaction script five times every day. The installation test does not directly modify the crontab, but it treats the cron entry as expected configuration and instructs the user to create it when absent. Recurring execution is useful for optional automation, but it is not necessary for the Skill's core search, browsing, liking, and favoriting functionality. These operations can be performed on demand. Making persistent scheduling part of the normal installation flow therefore exceeds the minimum execution lifetime needed for the core functionality. The cron target is located in `~/.openclaw/workspace/`, a user-controlled and potentially mutable location. Once the cron entry exists, any later modification or replacement of that script changes the code that cron executes without requiring another scheduling decision. ### Attack Path ...[truncated 1376 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/xhs_interaction_improved.sh:44
Finding

Predictable Temporary File Exposes MCP Session Headers

Content
View full analysis
/dev/null && grep -i 'Mcp-Session-Id' /tmp/xhs_headers | tr -d '\r' | awk '{print $2}') ``` ### Technical Analysis The script writes HTTP response headers to the fixed path `/tmp/xhs_headers`. Those headers contain the `Mcp-Session-Id` subsequently used to authorize tool calls against the local MCP service. A fixed filename in a shared temporary directory introduces two related weaknesses: 1. **Information exposure:** The header file is not deleted after parsing, leaving a potentially valid session identifier on disk. 2. **Symlink and race risk:** Another local process may create or replace `/tmp/xhs_headers` before execution. Because the script neither securely creates the file nor validates that it is a regular file owned by the current user, `curl` may follow a pre-existing symbolic link or interact with an attacker-controlled file. The actual exposure depends on system temporary-file protections, resulting file permissions, local account separation, and the validity period and authorization scope of the MCP session. ### Attack Path 1. A local attacker predicts the constant filename `/tmp/xhs_headers`. 2. Before or during script execution, the attacker monitors the path or creates a symbolic link at that location. 3. The script initializes an MCP session and directs `curl` to write the response headers to the predictable path. 4. If readable, the attacker extracts the `Mcp-Session-Id` from the retained header file. 5. While the identifier remains valid, the attacker may attempt calls t ...[truncated 907 chars]
Remediation
View remediation
/dev/null SESSION_ID=$( awk 'BEGIN { IGNORECASE=1 } /^Mcp-Session-Id:/ { sub(/\r$/, "", $2) print $2 exit }' "$HEADER_FILE" ) ``` The script should also reject an empty or malformed session identifier before making subsequent MCP requests. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (25)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The changelog documents automation of likes/favorites plus persistent recording of interaction history, but does not warn users about unattended account actions, potential platform policy violations, or retention of behavioral data. In the context of a social-platform automation skill, this omission increases the risk that operators deploy the tool without understanding account, privacy, and compliance consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation recommends running the automation on a schedule 3-5 times per day, encouraging repeated unattended interactions without disclosing platform-abuse, account-safety, or consent implications. Because this skill is specifically designed to automate engagement actions, scheduled execution materially increases the likelihood of misuse, detection, or account penalties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly instructs users to schedule repeated automated interactions (likes/favorites) on a third-party social platform, but it does not clearly warn that this can trigger unauthorized account actions, anti-abuse enforcement, or violations of Xiaohongshu platform rules. In this context, the automation is not merely informational; it operationalizes persistent account activity via cron, increasing the chance of misuse or account sanctions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The README instructs users to persist this automation through crontab, causing unattended, recurring account actions without an interactive approval step. In the context of social-platform engagement automation, session persistence makes misuse more dangerous because it continuously performs actions that may violate user expectations, platform policy, or account-security boundaries.

Content

Scanner excerpt · README.md (reported line 66)May include surrounding context.

2. 设置定时任务

bash
# 编辑crontab
crontab -e

# 添加定时任务(示例:每天执行5次)
31 12,14,16,18,20 * * * /home/chan/.openclaw/workspace/xhs_interaction_improved.sh

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill automates likes, favorites, and maintains persistent history/log files on the user's authenticated 小红书 account, but the description does not clearly warn the user that account actions and persistent tracking will occur. This creates a consent and transparency failure: a user may enable or schedule the skill without understanding that it will continuously perform engagement actions under their identity.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The documentation instructs users to install a cron job that repeatedly runs account-automation actions on a logged-in social media account. This creates persistent unattended execution, increasing the chance of unnoticed misuse, prolonged unauthorized activity if the workspace or account is compromised, and repeated platform-policy violations under the user's identity.

Content

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

2. 配置cron任务

bash
# 编辑crontab
crontab -e

# 添加以下行(示例:每天12:31、14:31、16:31、18:31、20:31执行)
31 12,14,16,18,20 * * * /home/chan/.openclaw/workspace/xhs_interaction_improved.sh

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install_test.sh (reported line 44)May include surrounding context.

sh
# 4. 检查cron任务
echo ""
echo "4. 检查cron任务..."
CRON_COUNT=$(crontab -l | grep -c "xhs_interaction_simple_fixed.sh")
if [ "$CRON_COUNT" -gt 0 ]; then
    echo "✅ cron任务已配置 ($CRON_COUNT 个任务)"
    crontab -l | grep "xhs_interaction_simple_fixed.sh"

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install_test.sh (reported line 47)May include surrounding context.

sh
# 4. 检查cron任务
echo ""
echo "4. 检查cron任务..."
CRON_COUNT=$(crontab -l | grep -c "xhs_interaction_simple_fixed.sh")
if [ "$CRON_COUNT" -gt 0 ]; then
    echo "✅ cron任务已配置 ($CRON_COUNT 个任务)"
    crontab -l | grep "xhs_interaction_simple_fixed.sh"

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Although the script does not automatically install a cron job, it explicitly instructs the user to create one that repeatedly runs another automation script from a user workspace. In the context of a social-platform automation skill, encouraging scheduled background execution increases risk because it establishes persistence for potentially policy-violating or abusive activity and could keep executing if the target script is later modified or replaced.

Content

Scanner excerpt · scripts/install_test.sh (reported line 51)May include surrounding context.

sh
else
    echo "⚠️  cron任务未配置"
    echo "   请运行以下命令配置cron:"
    echo "   crontab -e"
    echo "   添加:31 12,14,16,18,20 * * * bash /home/chan/.openclaw/workspace/xhs_interaction_simple_fixed.sh >> /home/chan/.openclaw/workspace/xhs_interaction.log 2>&1"
fi

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's comments and all user-facing output strings are in Chinese, which imposes a specific language on users. There is no opt-in, alternate locale, or documented justification that this is a China/Chinese-only skill, so it constitutes a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The script claims to avoid repeating actions on notes that were already interacted with, but it also records failed like/favorite attempts as permanent history entries. This can suppress future retries after transient MCP errors or temporary platform failures, causing incorrect state tracking and unintended automation behavior.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 44)May include surrounding context.

sh
# 初始化MCP会话
echo "1. 初始化MCP会话..." | tee -a "$LOG_FILE"
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
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 56)May include surrounding context.

sh
# 发送initialized通知
echo "2. 发送initialized通知..." | tee -a "$LOG_FILE"
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

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 63)May include surrounding context.

sh
# 发送initialized通知
echo "2. 发送initialized通知..." | tee -a "$LOG_FILE"
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

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 72)May include surrounding context.

sh
# 发送initialized通知
echo "2. 发送initialized通知..." | tee -a "$LOG_FILE"
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

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 91)May include surrounding context.

sh
# 发送initialized通知
echo "2. 发送initialized通知..." | tee -a "$LOG_FILE"
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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script automatically performs like and favorite actions on behalf of a logged-in account without explicit user approval at runtime. In a skill context, this is risky because it changes third-party account state, can violate platform policies, and can be abused to manipulate engagement or trigger account sanctions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This call performs an automated like action using the current logged-in account and platform-specific tokens obtained from search results. In context, it is dangerous because it modifies third-party platform state without user consent, can be used for engagement manipulation, and may expose the user to account enforcement or unintended actions if the MCP service or inputs are compromised.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 151)May include surrounding context.

sh
else
        # 执行点赞
        echo "  执行点赞..." | tee -a "$LOG_FILE"
        LIKE_RESPONSE=$(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":"like_feed","arguments":{"feed_id":"'"$FEED_ID"'","xsec_token":"'"$XSEC_TOKEN"'"}},"id":5}')

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This call automatically favorites content through the logged-in account using IDs and tokens pulled from prior results. In a skill environment, this is a state-changing action with abuse potential similar to the like flow, including unauthorized account activity, platform policy violations, and persistent changes to the user's profile data.

Content

Scanner excerpt · scripts/xhs_interaction_improved.sh (reported line 184)May include surrounding context.

sh
else
        # 执行收藏
        echo "  执行收藏..." | tee -a "$LOG_FILE"
        FAVORITE_RESPONSE=$(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":"favorite_feed","arguments":{"feed_id":"'"$FEED_ID"'","xsec_token":"'"$XSEC_TOKEN"'"}},"id":6}')

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

All user-facing natural-language content in this file is in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific audience. Under SQP-3, forcing a specific language without user opt-in can be a policy violation when not clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

A language/locale policy issue applies across all file types when the skill forces a specific language without user opt-in. This README is fully Chinese-language and provides no indication of multilingual support or that the language choice is intentional and user-selectable.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The natural-language content of the skill is entirely in Chinese, and the document does not offer an alternate language or indicate that Chinese is an intentional, opt-in locale requirement. Under the stated policy, forcing a specific language without user choice can be a locale-policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest description is written entirely in Chinese and references a China-specific platform, but it does not state that the skill is region-specific or that language selection is optional. Under the policy, forced language/locale behavior without opt-in or explicit justification can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

This shell script presents all user-facing comments and terminal messages in Chinese, such as the title and status prompts. The policy allows locale constraints only when justified or when the user is given a choice, neither of which appears in this file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file header and output messages describe this as an "安装测试脚本" and "检查脚本文件", which implies verification behavior. However, the code performs a state-changing operation with chmod +x on the target script, so the documented intent of testing/checking diverges from the actual behavior.

Content

No source excerpt is available for this finding.