Back to skill

Security audit

小红书舆情爬虫

Security checks for vulnerabilities and agentic risk

Overview

This skill is a Xiaohongshu scraping helper, but it asks users to run unreviewed third-party code while using account sessions and collecting potentially personal data.

Review this carefully before installing. Use an isolated environment, a dedicated low-privilege Xiaohongshu account where allowed, a separate browser profile, and avoid storing tokens or session data in shared locations. Do not run the external GitHub project unless you review and pin the exact commit and dependencies. Treat scraped comments, IP region, author data, databases, and media as potentially sensitive and delete or restrict access when no longer needed.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:52
Finding
Unpinned Third-Party Repository and Dependency Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 52–65 **Vulnerability Type**: Supply-chain exposure through mutable external code and unrestricted dependencies **Risk Level**: Medium ### Vulnerable Code ```bash # Clone the project git clone https://github.com/xiaofuqing13/redbooks.git cd redbooks # Create a virtual environment (recommended) python -m venv venv # Windows: venv\Scripts\activate # Linux/Mac: source venv/bin/activate # Install dependencies pip install -r requirements.txt ``` The subsequent documented execution command is: ```bash python crawler_ultimate.py ``` ### Technical Analysis The installation procedure directs users to clone the current state of an external Git repository, install packages from its externally maintained `requirements.txt`, and execute its Python entry point. The instructions do not pin the repository to a reviewed commit or release, verify repository artifacts using cryptographic hashes or signatures, or require hash-locked dependency versions. Neither `requirements.txt` nor `crawler_ultimate.py` is included in the audited project. Consequently, the effective code and dependency set executed by a user may change after this skill has been reviewed. A compromised upstream repository, malicious maintainer update, dependency takeover, or dependency-confusion event could introduce arbitrary installation-time or runtime code. The use of a virtual environment limits Python package contamination but does not sandbox execution. Packages installed in a virtual environment and scripts launched from it normally retain the invoking user's filesystem, network, process, and browser-profile access. ### Attack Path 1. An attacker compromises the referenced upstream repository, one of its maintainers, or a dependency named by its `requirements.txt`. 2. The attacker adds malicious code to `crawler_ultimate.py`, a package installation hook, or an imported dependency. 3. A user follows the skill instructions and clones t ...[truncated 1041 chars]
Remediation
## Remediation Suggestions 1. Pin the external repository to a specific reviewed commit hash rather than cloning and executing the mutable default branch. 2. Record the expected commit identifier and verify it explicitly before installation or execution. 3. Prefer vendoring the reviewed source code into the skill package so the audited implementation is the implementation users execute. 4. Replace an unrestricted `requirements.txt` with a lockfile containing exact versions and cryptographic hashes. Where applicable, install with `pip install --require-hashes`. 5. Pin transitive dependencies as well as direct dependencies and routinely scan them for known vulnerabilities and package ownership changes. 6. Verify release signatures or checksums when upstream provides them. 7. Review package build metadata and installation hooks before installation, and use binary-only packages where appropriate to reduce arbitrary build-script execution. 8. Run the crawler in a dedicated, least-privileged account or isolated container with restricted filesystem and network access. 9. Use a separate browser profile and a dedicated low-privilege platform account so compromise does not expose unrelated sessions or personal browser data. 10. Add an explicit review checkpoint to the documentation before any third-party code or dependencies are installed and executed.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill requires users to log into a Xiaohongshu account and also references obtaining a third-party API token, but it does not provide guidance on credential safety, token scoping, storage, or account-risk implications. In a scraping context, this increases the chance that users expose account sessions or API secrets, or use personal accounts in ways that lead to compromise, suspension, or unintended data access.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill explicitly instructs users to collect and locally store comments, author information, IP region, and media, but only provides a generic '学习研究使用' warning. It does not explain that this data may contain personal information, may trigger privacy-law or platform-policy obligations, and may create local data exposure risk if spreadsheets, databases, or downloaded media are retained insecurely.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
This code file contains user-facing natural-language descriptions and console messages exclusively in Chinese, including the module docstring and runtime output. Under the policy rule, forcing a specific language without user opt-in can be a locale/language policy violation when no choice or justification is provided.

External Transmission

Medium
Category
Data Exfiltration
Content
}
    
    try:
        response = requests.post(
            XHS_SEARCH_URL, 
            json=payload,
            headers=HEADERS,
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.