Back to skill

Security audit

小红书搜索摘要

Security checks for vulnerabilities and agentic risk

Overview

The skill is a mostly coherent Xiaohongshu scraper, but it runs mutable external tooling and can write files outside the intended output path under some inputs.

Install only if you are comfortable with a skill that launches a headed browser, may require Xiaohongshu login, scrapes posts/comments/images, and saves them locally. Prefer running it in a disposable workspace, choose a non-sensitive output directory, avoid path-like keywords, and pin/review Playwright dependencies before execution.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T08 · Insecure Dependencies

Error
Location
scripts/run.sh:126
Finding

Unpinned Playwright CLI Package Is Downloaded and Executed

Content
View full analysis
"$OUTPUT_DIR/xhs_data.json" ``` ### Technical Analysis The script invokes `@playwright/cli` through `npx` without specifying an exact package version or requiring a previously installed, lockfile-verified dependency. Depending on the local npm configuration and cache state, `npx` can retrieve the current package release from the configured registry and execute it immediately. Consequently, the code that runs is not fully represented by the audited project. Its behavior may change after the skill has been reviewed. A compromised registry account, malicious package release, registry redirection, or untrusted npm configuration could cause arbitrary package code to execute with the privileges of the user running the skill. ### Attack Path 1. An attacker compromises the `@playwright/cli` distribution channel, publishes a malicious release, or controls the npm registry configured on the host. 2. A user invokes `scripts/run.sh`. 3. `npx` resolves the unpinned package from the configured registry or cache. 4. The package's installation or runtime code executes locally. 5. The malicious package can access files, environment variables, browser state, and network resources available to the invoking user. ### Impact Assessment Successful exploitation permits arbitrary code execution with the operating-system privileges of the user or agent running the skill. The reachable scope can include: - Reading or modifying files accessible to the invoking account. - Accessing environment variables and locally available tokens. - Interacting with browser data and authenticated Xiaohongshu sessions. - Sending data over the network. - Modifying generated reports or scraper results. The code does not itself request elevated ...[truncated 89 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.sh:19
Finding

Predictable Temporary JavaScript File Permits Symlink and Race Attacks

Content
View full analysis
"$SCRIPT_PATH" async page => { ``` The predictable file is later read and passed to Playwright: ```bash npx @playwright/cli run-code "$(< "$SCRIPT_PATH")" > "$OUTPUT_DIR/xhs_data.json" ``` It is removed only after parsing: ```bash rm -f "$SCRIPT_PATH" ``` ### Technical Analysis The temporary filename is derived solely from the process ID and is created in the shared `/tmp` directory using ordinary shell redirection. It is not created atomically with exclusive semantics, no private temporary directory is used, and the code does not verify whether the path is a symbolic link. On a multi-user host, another local process can predict or observe the PID-based path. It may pre-create that path as a symbolic link, causing shell redirection to truncate and overwrite a file accessible to the victim account. A local attacker may also attempt to replace the temporary script between its creation and its later read at line 126. The absence of an `EXIT` trap also means the file can remain in `/tmp` when an earlier command fails or the script is interrupted. ### Attack Path #### Symlink overwrite path 1. A local attacker predicts or observes the target process ID. 2. The attacker creates `/tmp/xhs_scrape_.js` as a symbolic link to a file writable by the victim. 3. The script executes `cat ... > "$SCRIPT_PATH"`. 4. Shell redirection follows the symbolic link and truncates or overwrites the linked file with the generated JavaScript. #### Script replacement path 1. The scraper creates the predictable temporary file. 2. A local attacker with access to the shared temporary directory removes or replaces the file before line 126 reads it. 3. The substituted JavaSc ...[truncated 561 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/parse.py:53
Finding

Unsanitized Keyword Allows Report Path Traversal and File Overwrite

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:19
Finding

Untrusted Scraped Content Is Ingested Without Prompt-Injection Safeguards

Content
View full analysis
{line}\n" output_md += "\n" comments = post.get("comments", []) if comments: output_md += "**💬 Top 评论:**\n" for c in comments: user = c.get("user", "User") content = c.get("content", "").replace('\n', ' ') output_md += f"- **{user}**: {content}\n" ``` ### Technical Analysis Xiaohongshu post content is externally controlled and therefore untrusted. The skill requires the agent to read that content and visually inspect downloaded images, but it ...[truncated 2149 chars]
Remediation
View remediation
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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill description understates that it writes raw data and downloaded images to disk and does not itself implement the full analytical synthesis in the provided skill content. This is dangerous because it can trigger data collection and persistence beyond what a user may infer from a simple search/summarize capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The skill description understates that it writes raw data and downloaded images to disk and does not itself implement the full analytical synthesis in the provided skill content. This is dangerous because it can trigger data collection and persistence beyond what a user may infer from a simple search/summarize capability.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill requires and directs use of file read/write, network access, and potentially environment-dependent tooling, but does not declare any explicit tool scope or permissions boundary. This increases the chance the agent invokes broader capabilities than the user expects, especially because the skill also instructs local file creation and network retrieval of scraped content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation language is broad enough to match many generic research, summarization, or topic-compilation requests, which could cause the agent to invoke a browser-scraping skill when a simpler or safer method would suffice. In context, this matters because the skill performs network access, local downloads, and possible login-gated browsing on a third-party platform.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs downloading images and writing a synthesized report to local storage without prominently warning the user that scraped third-party content and derived analysis will be persisted on disk. This can create privacy, compliance, and data-retention risks, especially if the output directory is shared or synced.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

The script invokes npx @playwright/cli run-code without pinning an exact package version, so execution depends on whatever version resolves at runtime. In automation environments this creates a supply-chain risk: a newly published, compromised, or incompatible package version could execute arbitrary code during the skill run.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This skill is explicitly designed to scrape Xiaohongshu posts, images, and user comments, then save them to local output files, but the script provides no user-facing notice, consent mechanism, or data-handling controls. That creates privacy, compliance, and policy risk because third-party content and commenter data are being captured and persisted in bulk, potentially including personal data, without transparency or minimization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill states it bypasses anti-scraping by simulating a real user in a headed browser, and later notes the site may pause for login challenges. However, there is no upfront warning in the main description or usage section that browser automation and possible account authentication may occur, which affects privacy and account expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The generated report title is fixed in Chinese, and additional output strings such as post/comment labels are also Chinese-only. This forces a specific language without user opt-in, which matches the locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code fetches remote image content from URLs in the input data and saves the results into the user-supplied output directory. While the behavior is visible in code, there is no confirmation prompt or explicit user-facing warning that running the script will make outbound HTTP requests and create multiple files on disk.

Content

No source excerpt is available for this finding.