Back to skill

Security audit

RedBookSkills - 小红书发布助手

Security checks for vulnerabilities and agentic risk

Overview

This is a real Xiaohongshu automation skill, but it needs Review because it controls logged-in social accounts, includes avoid-detection guidance, and has unsafe local and network handling.

Install only if you are comfortable giving the skill control of a logged-in Xiaohongshu browser session. Use a dedicated test account and isolated Chrome profile, avoid remote CDP unless you control the host, do not pass untrusted media URLs, and do not use account names containing path characters. Review or patch the avoid-detection instruction, URL downloader limits, and profile deletion safeguards before production use.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/image_downloader.py:79
Finding

Unrestricted Media URL Fetching Enables Server-Side Request Forgery and Resource Exhaustion

Content
View full analysis
str: """ Download a single image and return the local file path. Args: url: Image URL to download referer: Optional Referer header. If None, auto-generates from URL domain. Raises requests.RequestException on network errors. """ # Build headers with Referer to bypass hotlink protection parsed = urlparse(url) if referer is None: referer = f"{parsed.scheme}://{parsed.netloc}/" headers = { "Referer": referer, "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", } resp = requests.get(url, timeout=DEFAULT_TIMEOUT, stream=True, headers=headers) resp.raise_for_status() ext = self._guess_extension(url, resp.headers.get("Content-Type")) filename = f"{uuid.uuid4().hex[:12]}{ext}" filepath = os.path.join(self.temp_dir, filename) with open(filepath, "wb") as f: for chunk in resp.iter_content(chunk_size=8192): f.write(chunk) def download_video(self, url: str, referer: str | None = None) -> str: """ Download a single video and return the local file path. Args: url: Video URL to download referer: Optional Referer header. If None, auto-generates from URL domain. Raises requests.RequestException on network errors. """ parsed = urlparse(url) if referer is None: referer = f"{parsed.scheme}://{parsed.netloc}/" headers = { "Referer": referer, "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", } re ...[truncated 3930 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/account_manager.py:138
Finding

Account Name Path Traversal Allows Arbitrary Directory Deletion

Content
View full analysis
bool: """ Add a new account. Args: name: Unique account name (used as identifier) alias: Display name / description Returns True if added, False if name already exists. """ data = _load_accounts() if name in data["accounts"]: return False from datetime import datetime profile_dir = os.path.join(PROFILES_BASE, name) os.makedirs(profile_dir, exist_ok=True) data["accounts"][name] = { "alias": alias or name, "profile_dir": profile_dir, "created_at": datetime.now().isoformat(), } _save_accounts(data) return True def remove_account(name: str, delete_profile: bool = False) -> bool: """ Remove an account. Args: name: Account name to remove delete_profile: If True, also delete the Chrome profile directory Returns True if removed, False if not found or is default. """ data = _load_accounts() if name not in data["accounts"]: return False # Don't allow removing the default account if it's the only one if name == data.get("default_account") and len(data["accounts"]) == 1: return False profile_dir = data["accounts"][name].get("profile_dir", "") del data["accounts"][name] # If we removed the default, set a new default if name == data.get("default_account"): data["default_account"] = next(iter(data["accounts"].keys())) _save_accounts(data) # Optionally delete the profile directory if delete_profile and profile_dir and os.path.isdir(profile_dir): try: shutil.rmtree(profile_dir) except Exception: pass return True ``` ### Technical Ana ...[truncated 2976 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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
Findings (81)

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The guidance to use randomness and simulate human behavior specifically to avoid system detection is an evasion instruction, not a normal reliability recommendation. In the context of a skill that automates publishing and interaction on Xiaohongshu, this directly facilitates bypassing platform anti-bot controls and increases the likelihood of abusive automation, account misuse, or policy-violating activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向小红书自动发布与内容交互的技能;而提供的代码仅是账户与本地浏览器配置管理的辅助脚本。它读写 config/accounts.json,创建和删除本地 Chrome 用户目录,并提供命令行子命令来管理默认账户和账户信息。虽然多账号管理可能为发布功能提供支持,但该代码块本身没有实现声明中的核心能力,例如发布图文/视频、启动测试浏览器、获取登录二维码、搜索笔记、抓取推荐内容、评论互动或抓取内容数据。相反,它包含了未声明但实际存在的本地账户/profile 管理与删除能力,因此描述与实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是小红书平台自动化运营,包括发布、登录、检索、抓取与互动;而提供的代码完全没有网络请求、浏览器自动化、平台API调用、账号登录处理、内容上传或抓取逻辑。代码仅在本地根据预设内容分布和主题库生成内容计划文本,并保存为calendar.md。其主要目的与声明严重不一致,且实际能力属于内容策划而非平台操作,因此应判定为明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

该代码块的核心能力与“自动发布图文/视频、登录检查”这部分声明基本一致,但声明将技能描述为一个覆盖发布、检索、抓取、互动等多能力的综合技能,而本代码仅实现发布流水线相关功能。它负责:解析 CLI 参数、确保 Chrome/CDP 可用、检查登录状态、下载媒体、填写发布表单、处理话题标签、以及可选地点击发布。虽然会在未登录时打开登录页,但没有看到任何“获取登录二维码”的专门输出或抓取逻辑;同样也没有搜索笔记、首页推荐抓取、评论/互动、内容数据抓取等行为。因此,声明明显夸大了该代码块实际具备的能力,应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

根据给定代码,这只是一个通用的单实例锁辅助模块,用于防止发布脚本重复并发执行。它通过锁文件和 PID 检查来判断是否已有进程运行,并在退出时清理锁。虽然注释提到 publish scripts,可视为发布流程的辅助实现细节,但该片段本身并未体现声明中描述的核心能力,如登录检查、二维码获取、发布图文/视频、首页推荐抓取、搜索笔记、评论互动或抓取内容数据。因此就“该代码片段是否准确代表声明描述”而言,存在明显不匹配:声明描述的是完整的小红书自动化技能,而实际代码仅是底层运行锁工具。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是小红书平台自动化运营/抓取/互动,而代码完全没有网络请求、浏览器控制、登录态处理、发布流程、检索或互动逻辑。相反,代码的主要用途是离线标签推荐与简单标签分析,这与声明的主要目的存在实质性不一致。虽然都与“小红书”相关,但功能领域不同,属于明显的描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明的核心能力是“小红书平台自动化操作与内容发布/抓取/互动”,而代码仅进行本地文本生成。代码中没有任何网络请求、浏览器自动化、登录态处理、二维码获取、发布接口调用、搜索或抓取逻辑,也没有评论/互动相关实现。其主要用途与声明明显不一致:声明是发布与平台运营自动化,实际是内容创作辅助工具。因此属于明显的描述与行为不匹配。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 若发布页结构异常,优先检查 `scripts/cdp_publish.py` 里的 `SELECTORS`、多图上传等待、正文编辑器与发布按钮点击逻辑;这些是最容易被小红书网页改版影响的区域。