Back to skill

Security audit

小红书笔记抓取与选题助手

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it asks for cookies or API tokens while allowing broad scraping and generic network requests that are not tightly scoped to Xiaohongshu note URLs.

Review this skill before installing. Only use it with Xiaohongshu URLs and tokens you are comfortable exposing to the exact destination being called, avoid raw cookie files where possible, do not point the generic API adapter at untrusted endpoints, and treat generated CSV/Markdown/templates as untrusted third-party-derived content that needs review before opening in spreadsheets or publishing.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_xiaohongshu_notes.py:59
Finding

Unrestricted URL Fetching Can Disclose Xiaohongshu Cookies and Enable SSRF

Content
View full analysis
str: headers = {"User-Agent": UA, "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8"} if cookie: headers["Cookie"] = cookie req = request.Request(url=url, headers=headers) with request.urlopen(req, timeout=timeout) as resp: return resp.read().decode("utf-8", errors="ignore") ``` The associated command-line and request flow is: ```python parser.add_argument("--url", help="Single Xiaohongshu note URL.") parser.add_argument("--url-file", help="File containing note URLs, one per line.") parser.add_argument("--cookie", help="Raw cookie header value.") parser.add_argument("--cookie-file", help="Read cookie header value from file.") parser.add_argument("--format", choices=["json", "md", "both"], default="json") parser.add_argument("--output", default="xhs_notes.json", help="Output path for JSON.") parser.add_argument("--timeout", type=int, default=20, help="HTTP timeout in seconds.") args = parser.parse_args() if not args.url and not args.url_file: parser.error("Provide at least one of --url or --url-file.") cookie = args.cookie if args.cookie_file: cookie = Path(args.cookie_file).read_text(encoding="utf-8").strip() urls = read_urls(args.url, args.url_file) if not urls: parser.error("No valid URLs found.") records: List[NoteRecord] = [] for url in urls: try: html = fetch_html(url, timeout=args.timeout, cookie=cookie) ``` ### Technical Analysis The script accepts arbitrary URLs from either `--url` or `--url-file` and passes them directly to `urllib.request.urlopen`. It does not validate: - The URL scheme. - The normalized destination hostname. - Whether the resolved address is public, private, loopback, link-local, ...[truncated 2282 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search_notes_generic.py:27
Finding

Generic API Adapter Sends Credentials to Arbitrary and Potentially Insecure Destinations

Content
View full analysis
Dict[str, str]: headers: Dict[str, str] = {"Accept": "application/json"} if args.auth_mode == "bearer": headers[args.auth_header] = f"Bearer {args.token}" elif args.auth_mode == "apikey": headers[args.auth_header] = args.token for k, v in parse_kv(args.header): headers[k] = v return headers ``` ```python parser.add_argument("--base-url", required=True, help="API endpoint URL, e.g. https://example.com/search") parser.add_argument("--token", default="", help="API token/key") parser.add_argument("--token-file", default="", help="Read token/key from file") parser.add_argument("--auth-mode", choices=["none", "bearer", "apikey"], default="bearer") parser.add_argument("--auth-header", default="Authorization", help="Header name for auth token") ``` ```python token = args.token if args.token_file: token = Path(args.token_file).read_text(encoding="utf-8").strip() if args.auth_mode != "none" and not token: parser.error("Provide --token or --token-file when auth-mode is bearer/apikey") args.token = token query_items: List[Tuple[str, str]] = [ (args.keyword_param, args.keyword), (args.page_param, str(args.page)), ] query_items.extend(parse_kv(args.param)) query_string = urlencode(query_items) sep = "&" if "?" in args.base_url else "?" url = f"{args.base_url}{sep}{query_string}" req = Request(url=url, headers=build_headers(args), method="GET") with urlopen(req, timeout=args.timeout) as resp: raw = resp.read().decode("utf-8", errors="replace") ``` ### Technical Analysis The adapter is intentionally generic, but it lacks safeguards around its most sensitive operation: reading a token and transmitting it to a caller-selected endpoint. `-- ...[truncated 1835 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/build_article_list_from_tikhub.py:159
Finding

Untrusted Note Fields Are Exported to CSV Without Formula Neutralization

Content
View full analysis
None: with out.open("w", newline="", encoding="utf-8") as f: writer = csv.DictWriter( f, fieldnames=[ "id", "title", "author", "liked_count", "collected_count", "comments_count", "shared_count", "hot_score", "url", "desc", ], ) writer.writeheader() writer.writerows(rows) ``` ### Technical Analysis Fields such as `title`, `author`, `desc`, and potentially `url` originate from remote TikHub/Xiaohongshu content. They are passed directly to `csv.DictWriter`. CSV quoting protects the file’s column structure, but it does not prevent spreadsheet applications from interpreting cells beginning with formula control characters such as: - `=` - `+` - `-` - `@` Some spreadsheet software also treats leading tabs, carriage returns, or other whitespace followed by a formula marker as executable formula content. An attacker who controls a note title, description, or profile name can therefore place a spreadsheet formula into the generated export. Execution occurs when a user opens the CSV in a compatible spreadsheet application and depends on that application’s security settings. ### Attack Path 1. An attacker publishes a Xiaohongshu note with a title, author name, or description beginning with a spreadsheet formula marker. 2. The Skill obtains the malicious field through TikHub. 3. `build_rows` preserves the attacker-controlled string. 4. `write_csv` writes it without neutralization. 5. A user opens `xhs_article_list.csv` in spreadsheet software. 6. The spreadsheet interprets the cell ...[truncated 706 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/interactive_filter_view.py:82
Finding

Interactive Filter CSV Export Is Vulnerable to Spreadsheet Formula Injection

Content
View full analysis
None: with out.open("w", newline="", encoding="utf-8") as f: writer = csv.DictWriter( f, fieldnames=[ "id", "title", "author", "liked_count", "collected_count", "comments_count", "shared_count", "hot_score", "desc", ], ) writer.writeheader() writer.writerows(rows) ``` ### Technical Analysis The interactive filtering tool reads TikHub response data and exports note titles, authors, and descriptions directly to CSV. Those fields are controlled by remote platform users. `csv.DictWriter` performs CSV escaping but does not force spreadsheet cells to be interpreted as text. Values beginning with formula markers can therefore be evaluated when the resulting file is opened in spreadsheet software. This is an independent vulnerable export path from the similar exporter in `build_article_list_from_tikhub.py`; fixing only one exporter would leave the other exploitable. ### Attack Path 1. An attacker creates a note or profile containing a formula-prefixed text field. 2. The malicious content appears in a TikHub JSON response. 3. A user processes that response with `interactive_filter_view.py`. 4. The script exports the value unchanged to `xhs_article_list.csv`. 5. The user opens the CSV in spreadsheet software. 6. The application evaluates the attacker-controlled cell as a formula, subject to its formula and security policies. ### Impact Assessment A successful exploit may cause: - Attacker-controlled outbound requests from spreadsheet software. - Disclosure of data available in the opened spreadsheet. ...[truncated 278 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (52)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill description promises note-link extraction and structured output, but the documented behavior includes calling a third-party TikHub search API and returning raw search results with search session parameters. This mismatch is dangerous because it obscures third-party data sharing and broad search/collection behavior that may have different privacy, compliance, and permission implications than direct page parsing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description promises note-link extraction and structured output, but the documented behavior includes calling a third-party TikHub search API and returning raw search results with search session parameters. This mismatch is dangerous because it obscures third-party data sharing and broad search/collection behavior that may have different privacy, compliance, and permission implications than direct page parsing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description promises note-link extraction and structured output, but the documented behavior includes calling a third-party TikHub search API and returning raw search results with search session parameters. This mismatch is dangerous because it obscures third-party data sharing and broad search/collection behavior that may have different privacy, compliance, and permission implications than direct page parsing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description promises note-link extraction and structured output, but the documented behavior includes calling a third-party TikHub search API and returning raw search results with search session parameters. This mismatch is dangerous because it obscures third-party data sharing and broad search/collection behavior that may have different privacy, compliance, and permission implications than direct page parsing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill description promises note-link extraction and structured output, but the documented behavior includes calling a third-party TikHub search API and returning raw search results with search session parameters. This mismatch is dangerous because it obscures third-party data sharing and broad search/collection behavior that may have different privacy, compliance, and permission implications than direct page parsing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill description promises note-link extraction and structured output, but the documented behavior includes calling a third-party TikHub search API and returning raw search results with search session parameters. This mismatch is dangerous because it obscures third-party data sharing and broad search/collection behavior that may have different privacy, compliance, and permission implications than direct page parsing.

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 156)May include surrounding context.

md
node scripts/fetch_xiaohongshu_note_playwright.js \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/fetch_xiaohongshu_note_playwright.js \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/fetch_xiaohongshu_note_playwright.js \

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's behavior materially exceeds the stated skill purpose. Instead of taking Xiaohongshu note URLs and extracting public note metadata, it accepts an arbitrary base URL plus arbitrary query parameter names and performs a generic authenticated GET request, making it a general-purpose API client that can be repurposed for unrelated data access or exfiltration. In the context of an agent skill, this broad network capability is dangerous because it enables abuse under the cover of a narrowly described note-fetching tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script allows arbitrary outbound requests to any user-supplied endpoint and lets callers attach custom headers and authentication material. That combination effectively turns the skill into a reusable HTTP client, which can be used to contact attacker-controlled infrastructure, probe internal-accessible services from the agent environment, or send sensitive tokens to unintended destinations. Because the manifest claims only public note extraction, this extra capability is unjustified and increases the risk significantly.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The publishing notes advertise capabilities that go beyond the declared skill scope, including keyword-based search, topic-assistant behavior, and broader TikHub API data collection. This creates a scope mismatch that can mislead reviewers and users about what the skill actually does, increasing the risk of undisclosed data access, overcollection, or unexpected automation paths.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents capabilities that read local files, write output files, and make network requests, but it declares no explicit tool/permission scope. This weakens sandboxing and user visibility, increasing the chance that an agent could invoke broader capabilities than intended when handling URLs, cookies, tokens, or local input files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest states that the skill extracts information from user-provided note URLs, but the body documents keyword-based search and multi-page collection via third-party APIs. Security decisions often rely on manifest text, so this inconsistency can cause underestimation of collection scope, third-party exposure, and rate/abuse risks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes note-page extraction, but the documentation adds article list generation, publish templates, interactive filtering, and mind-map outputs. These secondary processing features materially expand the skill from extraction into analysis and content generation, creating hidden capability surface that can affect user consent and policy review.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
84% confidence
Finding

Using npx playwright without pinning a version introduces supply-chain risk because the executed package version can change over time or resolve unexpectedly. In a skill that performs browser automation and network access, an unpinned dependency can lead to arbitrary code execution during install or runtime if the package or its transitive dependencies are compromised.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill manifest says it extracts and structures public Xiaohongshu note data, but this code also generates 'publish-ready' article templates derived from third-party notes. That expands the capability from data extraction into content repurposing, which can facilitate plagiarism, impersonation of original creators, or policy-violating reuse without user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script creates publication-oriented output from third-party content without warning users that the material originates from someone else's note or that human review is required. In the context of a note-fetching/extraction skill, this makes unauthorized reuse easier and increases the chance of deceptive or non-compliant downstream publication.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill accepts a raw cookie file and injects authenticated cookies into the browser context, allowing it to access content visible only to a logged-in account. That exceeds the declared scope of public-page extraction and can cause collection of account-gated data under the user's session, creating privacy, authorization, and scope-creep risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script reads a raw cookie header from disk and silently uses it for browser authentication without any user-facing warning, validation, or disclosure. Session cookies are highly sensitive credentials; undisclosed handling increases the chance of accidental over-collection, misuse of authenticated sessions, or insecure operational practices around credential files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code actively clicks close buttons and removes login/overlay elements from the DOM to continue scraping. That is a deliberate bypass capability aimed at defeating access-friction or consent/interstitial UI, making the skill more capable than a simple public-page extractor and increasing the risk of unauthorized or policy-violating collection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script accepts arbitrary user-supplied URLs and fetches them without validating that they belong to Xiaohongshu note pages. In an agent context, this creates a server-side request forgery style capability that can be repurposed to access unintended internal, local, or sensitive network resources while appearing to be a benign note-fetching tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The tool accepts raw cookies from command-line input or a file and forwards them directly in outbound requests, despite being described as a public-page scraper. This broadens the skill from public scraping into authenticated session use, increasing the risk of credential misuse, accidental session leakage, and access to data beyond the intended scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script transmits supplied cookies to the requested URL without any explicit warning that authentication or session data may be sent over the network. Because URL input is also unrestricted, a user or upstream agent could unintentionally send live session cookies to an unintended destination, compounding the risk of credential leakage.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.