Back to skill

Security audit

cn-data-scraper

Security checks for vulnerabilities and agentic risk

Overview

This skill is a Chinese-site scraping helper, but it includes anti-crawl/login-wall bypass guidance and an unsafe executable script that can run injected code or overwrite files.

Install only if you are prepared to review and constrain it carefully. Use it only for authorized scraping, prefer official APIs, avoid login-gated or protected data unless you have explicit permission, and do not run the bundled scrape.sh with untrusted inputs or sensitive output paths. Install dependencies in an isolated environment and pin versions if you proceed.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/scrape.sh:5
Finding

Arbitrary Python Code Execution Through Unsanitized CLI Arguments

Content
View full analysis
[output_file]" echo "Platforms: baidu zhihu weibo csdn" echo "" echo "Note: taobao/douyin/1688/xiaohongshu require login cookies." echo "Use the Python API with cookie injection for these platforms." exit 1 fi python3 -c " from scrapling import StealthyFetcher, Fetcher import json import sys platform = '$PLATFORM' keyword = '$KEYWORD' output = '$OUTPUT' ``` ### Technical Analysis The script embeds three user-controlled shell arguments directly into a Python program passed to `python3 -c`. Shell quoting does not make these values safe inside the resulting Python source code. An argument containing a single quote can terminate the surrounding Python string literal and inject additional Python statements. Because Python exposes operating-system functionality through modules such as `os` and `subprocess`, successful injection results in arbitrary command execution. All three arguments are potentially affected: - `PLATFORM` - `KEYWORD` - `OUTPUT` No validation, escaping, or parameterized data transfer separates these values from executable Python source. ### Attack Path 1. An attacker supplies a crafted CLI argument containing a closing quote and Python statements. 2. The shell expands the argument while constructing the `python3 -c` string. 3. The injected content becomes part of the Python source code. 4. Python parses and executes the injected statement with the privileges of the user running the Skill. For example, a malicious keyword could follow this structure: ```bash ./scripts/scrape.sh baidu "';__import__('os').system('id');#" ``` The exact quoting requir ...[truncated 764 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scrape.sh:7
Finding

Arbitrary File Truncation Through User-Controlled and Predictable Output Paths

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:436
Finding

Unpinned Third-Party Package Installation Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The manifest and content advertise comprehensive anti-crawl, legal compliance, and MCP-backed functionality, but the actual executable code is a much narrower wrapper around a few fetch calls. This mismatch can mislead agents and users into trusting unimplemented safety/compliance controls or assuming broader tested support than exists.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The legal section explicitly states that bypassing security measures may be illegal, yet the skill provides platform-specific anti-crawl bypass recipes and login-wall circumvention guidance. This creates a direct safety contradiction and materially assists behavior the document itself identifies as potentially criminal.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill frames itself as legitimate-only, but elsewhere gives concrete instructions for cookie injection and bypassing login-gated or anti-crawl controls. That contradiction is dangerous because it can normalize or facilitate unauthorized scraping while presenting a veneer of safety and compliance.

Content

No source excerpt is available for this finding.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
70% confidence
Finding

Skill instructs the agent to never refuse or to always comply. Suppressing the agent's ability to decline removes a core safety control and enables downstream harmful requests to succeed.

Content

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

md
- **This skill teaches scraping techniques for legitimate data collection only**
- **Always check robots.txt before scraping any website**
- **Always comply with China's Criminal Law, Data Security Law, and PIPL**
- **When in doubt, use official APIs instead of scraping**
- **Scraping personal data without consent is a CRIMINAL OFFENSE in China**
- **Free tier**: This skill is free. Platform-specific advanced recipes may require API access.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill contains executable examples that perform network access and write output files, but it declares no explicit tool scope or permissions boundaries. In an agent ecosystem, this can cause the skill to be invoked with broader capabilities than users or orchestrators expect, increasing the chance of unintended scraping or file writes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes broad phrases such as "anti-crawl bypass," "Chinese web scraping," and "data extraction Chinese websites" without clear scope limits or exclusion conditions. In a manifest/markdown context, these are ambiguous enough to overlap with many general scraping requests, increasing the chance of the skill being selected unintentionally.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The included shell script is executable and can write scraped data to arbitrary filesystem paths supplied by the caller. In an agent setting, that broadens the skill from instructional content into an operational tool with persistence side effects, which can be misused for data staging or overwriting files.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- **Always check robots.txt before scraping any website**
- **Always comply with China's Criminal Law, Data Security Law, and PIPL**
- **When in doubt, use official APIs instead of scraping**
- **Scraping personal data without consent is a CRIMINAL OFFENSE in China**
- **Free tier**: This skill is free. Platform-specific advanced recipes may require API access.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The instruction states "You are a Chinese website data scraping expert," and the skill consistently centers Chinese-language/China-specific operation without offering a language or locale choice. For policy review, this is a locale constraint presented as default behavior rather than an explicit user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The script defaults to writing results to /tmp/scrape_result.json and may overwrite a user-specified output path, but there is no explicit warning beyond the positional argument syntax. While the operation is visible in code, the user-facing help does not clearly disclose that running the script creates or overwrites a file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code issues HTTP requests to third-party sites using the user-supplied search keyword, but the script does not disclose that the keyword will be transmitted externally. The usage text names platforms but does not warn about network activity or data sharing, so users may not realize their query is being sent to external services.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.