Back to skill

Security audit

小红书热点半自动化发布系统

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a Xiaohongshu content-page generator, but its generated HTML can run unwanted browser code if crafted topic or brand text is used.

Review before installing. Use only trusted theme and brand inputs, or fix HTML escaping before opening generated pages. Remove python>=3.8 from requirements.txt and document the interpreter version elsewhere. Expect generated HTML/JSON files and browser-side publication state to persist locally; demo and test scripts may create example files and open a browser when prompted.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
create_hot_publish_page.py:609
Finding

Persistent HTML and JavaScript Injection Through Unescaped User Input

Content
View full analysis
{content["title"]} ``` ```python # Add tags for tag in content['tags']: hot_class = 'hot-tag' if '热点' in tag or '热门' in tag else '' sections_html += f'#{tag}\n' ``` Only the main content body receives HTML escaping: ```python
{self._escape_html(content["content"])}
``` ### Technical Analysis The constructor accepts `theme` and `brand_name` as strings and only removes leading and trailing whitespace. These values are subsequently used in generated titles, tags, and direct template placeholder replacement. No context-appropriate escaping is applied before the values are inserted into HTML text contexts. Although `_escape_html()` exists, it is only used for the generated content body. It does not protect the document title, brand subtitle, generated content titles, or tags. For example, a malicious brand value can terminate the fallback template's `` element: ```html ``` When this value replaces `{{BRAND_NAME}}`, the resulting saved document contains executable attacker-controlled JavaScript. A malicious theme can also reach generated title and tag elements and inject arbitrary HTML. The payload is p ...[truncated 1720 chars]
Remediation
View remediation
` element and parse its text content. 5. Add a restrictive Content Security Policy to generated documents where practical. Avoid allowing inline scripts if the full template is restored. 6. Add regression tests using hostile inputs such as: ```python '' '' '">' '' ``` The tests should verify that these values appear only as encoded text and do not create executable elements. ]]>

T08 · Insecure Dependencies

Note
Location
requirements.txt:5
Finding

Interpreter Version Incorrectly Declared as an Installable Package

Content
View full analysis
=3.8 ``` The project documentation instructs users to run: ```bash pip install -r requirements.txt ``` ### Technical Analysis A pip requirements file describes packages to retrieve and install; it does not declare the required Python interpreter version. Consequently, `python>=3.8` is interpreted as a request for an installable distribution named `python`, rather than as a requirement that the active interpreter be Python 3.8 or newer. Depending on the configured package index and packages available there, this can cause installation failure or retrieval of an unrelated package. In environments using private or additional package indexes, an attacker able to publish or substitute a matching package name could potentially obtain code execution during dependency installation. No evidence shows that this project intentionally provides or relies on such a package. The issue is a configuration flaw that unnecessarily creates a supply-chain lookup. ### Attack Path 1. A user follows the documented installation command: ```bash pip install -r requirements.txt ``` 2. Pip interprets `python>=3.8` as a package requirement. 3. Pip searches the configured public, private, or supplemental package indexes for a distribution named `python`. 4. If an attacker-controlled compatible distribution is selected, pip downloads and installs it. 5. Package installation behavior or subsequently imported package code could execute with the privileges of the user running pip. This path is conditional on a matching attacker-controlled package being available through the user's configured index resolution process. ### Impact Assessment The most likely result is installation failure or installation of an unintended package. In a succe ...[truncated 386 chars]
Remediation
View remediation
=3.8 ``` 2. Declare the interpreter requirement in `pyproject.toml` instead: ```toml [project] requires-python = ">=3.8" dependencies = [] ``` 3. If the project continues to use only the Python standard library, keep `requirements.txt` empty or remove it and clearly state that there are no runtime package dependencies. 4. Use a virtual environment for all development installations and avoid running pip with elevated privileges. 5. If future third-party dependencies are introduced, pin or constrain reviewed versions and use hash verification or a locked dependency file for reproducible installations. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (17)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

该贡献指南在自然语言中明确规定“使用中文编写文档”,属于强制单一语言要求。根据规则,若未提供语言/区域选择或未说明这是特定区域合规需要,则构成语言/locale政策违规。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

All user-facing documentation and invocation guidance in this file are presented only in Chinese, with no opt-in or alternative language option. This can violate language/locale policy expectations when a skill is distributed to a broader audience unless the locale restriction is explicitly stated and justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README states the skill auto-activates on generic phrases like “小红书发布” and “一键发布”, which are broad enough to trigger unintentionally during normal conversation. In an agent framework, overly broad activation can cause the skill to run in the wrong context, leading to unintended content generation or downstream actions the user did not explicitly request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation triggers are broad enough to match ordinary content-generation requests, which can cause the skill to invoke when the user did not explicitly ask for this publishing workflow. That creates a prompt-squatting style risk: the agent may unexpectedly generate and present publishing UI, open external workflows, or steer the session into this skill instead of the user’s intended task.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python skill is full of natural-language strings and explicitly generates Chinese-language Xiaohongshu content and a zh-CN HTML page. The file does not offer any language or locale opt-in, fallback, or documented justification for forcing Chinese output, which matches the language/locale policy-violation criterion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains natural-language descriptions and console output entirely in Chinese, presenting the skill as a general demo system rather than a clearly region-limited tool with documented language requirements. Under the policy, forcing a specific language without user opt-in or justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file's user-facing description and prompts are entirely in Chinese, and the interactive flow later continues exclusively in Chinese without any opt-in or language-selection mechanism. Under the stated policy, forcing a specific language is a natural-language policy violation unless the locale constraint is explicitly justified or optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The usage guide says the skill auto-activates when the user mentions Chinese keywords such as "小红书发布", which presumes a single language/locale and does not provide an alternative or opt-in. This is a natural-language policy concern because it hardcodes one language for invocation behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring describes the file as a test/verification script, but running it can create a persistent demo HTML file and optionally open the user's browser. This mismatch can cause unexpected side effects in environments that assume test code is non-invasive, increasing the risk of unintended file creation or UI interaction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring is entirely in Chinese and presents the skill as a general test system, but it does not offer any language or locale choice to users. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

该文档从标题到说明链接均以中文呈现,没有提供多语言选项、语言切换提示或说明这是仅面向中文用户的区域性项目。根据规则,强制特定语言且无用户选择或明确正当说明,属于自然语言层面的语言/区域政策问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises saving publishing state in browser local storage but does not warn users that activity metadata persists on the device. While not a direct exploit by itself, retained publication history can expose user behavior to other local users, browser profiles, or scripts running in the same origin.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill documents use of local storage for publication state, but the description does not clearly warn users up front that browser-side persistence will occur. This can create an informed-consent and privacy issue because users may not realize posting workflow metadata remains stored across refreshes or later sessions on the same device.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file-level docstring and CLI description present the skill as a page generator for Xiaohongshu publishing. However, when an output path is provided, the implementation silently performs an additional side effect by exporting all generated content and metadata as a sibling .json file, which is not reflected in the stated intent/documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comments, status messages, and user-facing instructions in the script are consistently Chinese-only, which imposes a specific language on users. Under the policy, this is a natural-language locale violation unless the skill offers opt-in language choice or clearly documents a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This requirements file uses Chinese comments throughout, such as the header and installation notes, but does not indicate that Chinese is optional or that the skill is intended only for a Chinese-speaking audience. Under the language/locale policy rule, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
50% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · requirements.txt (reported line 5)May include surrounding context.

text
# 版本: 1.1.0

# 核心依赖
python>=3.8

# 开发依赖(可选)
# pytest>=7.0.0

Static analysis

No suspicious patterns detected.