Back to skill

Security audit

Scrapling Web Scraping

Security checks for vulnerabilities and agentic risk

Overview

This skill openly provides web scraping with Cloudflare and anti-bot bypass features, but its scope and safety controls are too broad for automatic installation without review.

Install only if you intend to use an anti-bot-capable scraper and can enforce your own controls: use it only on owned or authorized targets, run it in an isolated non-root environment with restricted egress, avoid internal or metadata URLs, pin and review dependencies, and require explicit user approval before stealth or Cloudflare-bypass modes.

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

Warning
Location
scrapling_tool.py:24
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: scrapling_tool.py:24, scrapling_tool.py:42-44, scrapling_tool.py:61, and scrapling_tool.py:78
Vulnerability Type: Server-Side Request Forgery through unrestricted user-controlled URLs
Risk Level: Medium

Vulnerable Code

python
def scrape_basic(url, selector=None):
    """基础抓取"""
    try:
        page = Fetcher.get(url)
python
def scrape_stealth(url, selector=None, solve_cloudflare=False):
    """隐身模式抓取(绕过Cloudflare)"""
    try:
        page = StealthyFetcher.fetch(url, 
                                      headless=True,
                                      solve_cloudflare=solve_cloudflare)
python
def scrape_dynamic(url, selector=None, wait_for=None):
    """动态内容抓取(JavaScript渲染)"""
    try:
        page = DynamicFetcher.fetch(url, headless=True, network_idle=True)
python
parser.add_argument('url', help='Target URL to scrape')

Technical Analysis

The command-line caller completely controls the URL passed to all three network fetchers. The implementation does not validate the URL scheme, hostname, resolved IP address, destination port, or redirect targets.

Consequently, a caller may instruct the process to connect to destinations that are normally inaccessible from the caller's own network context, including:

  • Loopback services such as 127.0.0.1 or ::1.
  • RFC1918 private network services.
  • Link-local addresses.
  • Cloud instance metadata endpoints.
  • Internal hostnames resolved by the host's DNS configuration.

DNS-based validation would not be sufficient by itself. A secure implementation must validate every resolved address and repeat the validation after redirects to prevent DNS rebinding and redirect-based bypasses.

In basic mode, a request without a selector stores the response body in result["text"]. JSON output then serializes the complete result, allowing accessible inter ...[truncated 1638 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse URLs with a standards-compliant URL parser and permit only explicitly required schemes, normally https and optionally http.
  2. Reject URLs containing credentials, malformed hostnames, unsupported ports, or ambiguous numeric IP representations.
  3. Resolve the hostname before connecting and reject every address classified as loopback, private, link-local, multicast, reserved, unspecified, or otherwise non-global.
  4. Explicitly block cloud metadata addresses and hostnames, including relevant IPv4 and IPv6 forms.
  5. Disable automatic redirects or validate the scheme, hostname, port, and resolved addresses of every redirect target before following it.
  6. Protect against DNS rebinding by ensuring the validated address is the address used for the connection, or enforce the restriction through a trusted outbound proxy.
  7. Prefer an explicit destination allowlist when the expected scraping targets are known.
  8. Apply egress firewall rules so the process cannot reach loopback, private networks, metadata services, or sensitive management networks.
  9. Limit response size, request duration, and redirect count to reduce denial-of-service exposure.
  10. Avoid returning full response bodies by default, especially when requests can be initiated through an Agent or remotely accessible service.
  11. Add tests covering IPv4, IPv6, encoded IP addresses, redirects to private destinations, and DNS rebinding scenarios.

T08 · Insecure Dependencies

Note
Location
SKILL.md:17
Finding

Unpinned Third-Party Package and Browser Component Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:17-21
Vulnerability Type: Unpinned dependency and mutable external component installation
Risk Level: Low

Vulnerable Code

bash
# Install Scrapling
pip install "scrapling[all]"
scrapling install

Technical Analysis

The documented installation procedure installs the latest package version satisfying the unconstrained scrapling[all] requirement. The broad all extra can introduce additional transitive dependencies that are not individually pinned or reviewed.

The subsequent scrapling install command downloads browser components through package-controlled installation logic. The documentation does not specify package versions, a dependency lockfile, expected artifact versions, cryptographic hashes, or a trusted package index.

This does not establish that the current upstream package is malicious. The risk is that future installation results are mutable and therefore may differ from the code that was originally audited. A compromised release, dependency account, package index, transitive dependency, or downloaded browser artifact could execute code during installation or later at runtime.

Attack Path

  1. An administrator follows the installation commands from SKILL.md.
  2. pip resolves the current version of scrapling and all dependencies enabled by the all extra.
  3. Because versions and hashes are not constrained, artifacts published after this skill was reviewed can be selected.
  4. The scrapling install command downloads additional browser-related components according to the installed package's current behavior.
  5. If any selected package or downloaded artifact has been compromised, malicious code may execute with the privileges of the user performing installation or when the scraper is subsequently run.

Impact Assessment

The potential privilege level is that of the account running pip, scrapling install, or the s ...[truncated 525 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin scrapling to an exact, reviewed version rather than installing an unconstrained latest release.
  2. Generate and commit a lockfile containing exact versions of all transitive dependencies.
  3. Require cryptographic package hashes, for example through a reviewed requirements file used with pip --require-hashes.
  4. Pin browser component versions and verify downloaded artifacts against trusted checksums or signatures.
  5. Document the approved package index and disable unexpected supplementary indexes to reduce dependency-confusion exposure.
  6. Replace the broad all extra with only the minimum extras required by the supported modes.
  7. Install dependencies in an isolated virtual environment or container under a non-root account.
  8. Review dependency updates before changing pins and use automated vulnerability and provenance scanning.
  9. Produce a software bill of materials for the Python and browser components.
  10. Separate dependency installation from normal skill execution so runtime invocations cannot silently retrieve changed components.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description explicitly advertises bypassing Cloudflare, anti-bot detection, and operating in 'stealth' or 'undetectable' modes without any stated limitation, authorization requirement, or user opt-in. This materially increases the risk that the skill will be used to evade website defenses, violate terms of service, and access or extract data from protected services at scale.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly enables outbound network activity, including scraping third-party sites and browser automation, but the manifest does not declare any tool scope or permissions. In an agent ecosystem, undeclared network capability weakens governance, user consent, and policy enforcement because the skill can induce external requests without explicit scoping.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description emphasizes bypassing Cloudflare, anti-bot evasion, and stealth automation, but it does not warn about legal, privacy, or operational risks of sending requests to third-party sites. That omission is dangerous because users may unknowingly direct the agent to interact with protected services in ways that violate terms, expose identifiers, or trigger account/IP blocking.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description is broadly worded as a general-purpose capability for scraping protected and dynamic websites, without clear trigger constraints, permission requirements, or exclusions. In an agent environment, this can cause over-invocation and normalize use against sites where scraping or automation may be unauthorized, increasing misuse risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Policy-violation checks apply to all file types, including markdown. The 'Natural Language Commands' section presents only Chinese invocation examples, which effectively forces a specific language for use without stating that other languages are supported or that the skill is intentionally Chinese-only for a documented reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code contains user-facing and descriptive natural language in Chinese (for example the module description), while the rest of the CLI is in English, and it does not state that the tool is intentionally Chinese-only or provide a language/locale option. That can violate a language/locale policy requiring user choice or clear documentation of locale constraints.

Content

No source excerpt is available for this finding.