Scrapling
- Type
- MCP server
- Scanned
- Nov 18, 2026
- Version
- 2998c9ebba52
- Files read
- 650
Scrapling is a web scraping tool and AI assistant plugin that fetches web pages, controls automated browsers, and extracts data from websites. The biggest risk is that a malicious webpage could trick a connected AI assistant into running any program on your computer, reading local files, or accessing logged-in browser sessions, including through tools marked read-only for automatic approval.
What it can reach
- Network
- Sends web requests to any website address, routes traffic through custom proxies, connects to remote browsers, and can run a local server on port 8000.
- Browser
- Launches Chromium or installed Google Chrome, connects to already-running browsers, runs JavaScript on web pages, takes screenshots, and captures network traffic, cookies, and saved site data.
- Files
- Reads and writes scraped output files, caches, databases, crawl checkpoints, custom scripts, and browser login files, and can read any local file through file:// links.
- Shell commands
- Runs setup commands to install Python packages and browsers, offers an interactive Python console, and can execute any program path or startup flags passed to its browser tools.
- Secrets
- Reads and exports browser login sessions (including cookies and saved site storage), reuses active logged-in browsers, and reads proxy credentials and its server authentication token.
Findings
-
HighArbitrary command execution via executable_path and additional_args in MCP browser tools
scrapling/core/ai/server.py:347
Both browser_fetch_once and browser_open expose executable_path and additional_args directly to the AI agent, and browser_fetch_once is annotated with read_only_hint=True so MCP clients like Claude Code can auto-approve it without asking the user. Validation only checks that executable_path is an existing absolute file, and additional_args (described as context options) is merged over _browser_options into Patchright's launch_persistent_context, allowing a prompt-injected agent to run any local binary or override process launch options such as args (for example --renderer-cmd-prefix), env, and ignore_default_args.
Fix: Remove executable_path from MCP tool arguments so only the operator can set it via --executable-path or SCRAPLING_EXECUTABLE_PATH, and filter additional_args against an allowlist of safe browser-context options so it cannot override process launch settings like args, env, or ignore_default_args.
-
HighLocal file disclosure via file:// URLs in MCP fetch tools
scrapling/core/ai/server.py:793
None of the MCP fetching tools (make_request, session_make_request, browser_fetch_once, and browser_fetch) restrict the URL scheme to http or https before passing url to curl_cffi or Chromium's page.goto. Because both engines read local files and directory listings for file:// URLs and all four tools carry read_only_hint=True, a webpage containing a prompt injection can trick the agent into reading sensitive local files (such as ~/.ssh/id_rsa or .env with main_content_only=False) without user confirmation and sending them to an external server.
Fix: Validate that url uses http:// or https:// in make_request, session_make_request, browser_fetch_once, and browser_fetch, and reject file:// and other non-web schemes.
-
HighSpider LinkExtractor follows file:// URLs found in untrusted pages and sitemaps
LinkExtractor includes 'file' in valid_schemas alongside 'http' and 'https'. When CrawlSpider or SitemapSpider crawls an untrusted site with default settings (empty allowed_domains), a malicious <a href='file:///etc/passwd'> link or sitemap <loc> entry is extracted and fetched from the local disk into the spider's callbacks; on Windows, even when allowed_domains is set (such as in ContentSpider), a link like file://allowed-domain.example/share/path matches Request.domain and triggers an outbound SMB request that leaks NTLM credentials.
Fix: Remove 'file' from valid_schemas in scrapling/spiders/links.py so LinkExtractor only permits http and https URLs.
-
MediumCLI HTTP extract commands disable SSRF redirect protection despite documentation claiming 'safe'
While Fetcher defaults follow_redirects to 'safe' (blocking HTTP redirects to loopback, link-local, and private IPs) and SKILL.md tells AI coding agents that --follow-redirects defaults to 'safe', _common_http_options in scrapling/cli.py defines --follow-redirects as a boolean flag defaulting to True. Passing follow_redirects=True to Fetcher overrides 'safe' in curl_cffi, allowing any external URL scraped via scrapling extract get/post/put/delete to 302-redirect to internal services or cloud metadata endpoints (such as 169.254.169.254) and save the response to the output file.
Fix: Translate --follow-redirects=True to 'safe' by default in scrapling/cli.py (for example follow_redirects='safe' if follow_redirects else False) so CLI HTTP commands preserve SSRF redirect protection.
-
MediumAll stealth browser sessions disable HTTPS certificate verification by default
scrapling/engines/_browsers/_base.py:584
StealthySessionMixin unconditionally sets ignore_https_errors=True in _context_options for StealthyFetcher, StealthySession, AsyncStealthySession, RemoteSession, the CLI fetch command, and all MCP browser tools, with no verify option to turn certificate checking back on. A network attacker or untrusted proxy can intercept HTTPS browser sessions with a self-signed certificate to read cookies and credentials or inject content into pages.
Fix: Default ignore_https_errors to False and expose an explicit verify or ignore_https_errors parameter for callers that intentionally scrape sites with broken TLS certificates.
-
MediumXMLFeedSpider and SitemapSpider parse untrusted XML with default entity resolution settings
scrapling/spiders/templates/sitemap.py:120
SitemapSpider (and XMLFeedSpider in scrapling/spiders/templates/feed.py) parses remote XML bodies using lxml.etree.fromstring(body) without passing XMLParser(resolve_entities=False, no_network=True). Because lxml's default XMLParser sets resolve_entities=True, environments whose libxml2 honors XML_PARSE_NOENT for local file URIs can expand external file:// entities inside <loc> tags that SitemapSpider then follows over HTTP.
Fix: Pass parser=etree.XMLParser(resolve_entities=False, no_network=True, load_dtd=False) to etree.fromstring(body) in both scrapling/spiders/templates/sitemap.py and scrapling/spiders/templates/feed.py.
-
LowState-changing POST, PUT, and DELETE MCP tools are marked read_only_hint=True
scrapling/core/ai/server.py:106
make_request and session_make_request accept POST, PUT, and DELETE methods with arbitrary form or JSON bodies and session cookies, yet both tools are registered with _FETCH_TOOL_ANNOTATIONS (read_only_hint=True). In MCP clients that auto-approve read-only tools, a prompt-injected agent can perform state-modifying HTTP requests or exfiltrate large payloads via POST without human approval.
Fix: Set read_only_hint=False (and destructive_hint=True) on make_request and session_make_request, or split GET into a separate read-only tool.
-
LowUnrestricted host file overwrite in browser_save_state and browser_load_state
scrapling/core/ai/server.py:368
browser_save_state and browser_load_state pass the agent-supplied path directly to Playwright's storage-state APIs without confining it to a dedicated directory or file extension. If tricked by prompt injection, the agent can overwrite and corrupt arbitrary writable files anywhere on the host filesystem with JSON storage data.
Fix: Restrict state files to a dedicated directory (for example ~/.scrapling/states/), reject path traversal segments and directory separators, and enforce a .json extension.
-
LowStealth browser sessions automatically grant geolocation permission to all websites
scrapling/engines/_browsers/_base.py:587
StealthySessionMixin grants the geolocation and notifications permissions in _context_options for every browser session, including MCP browser fetches and CLI fetch calls. Any visited webpage can call navigator.geolocation.getCurrentPosition() in JavaScript without a prompt and read the host machine's physical location if OS location services are available.
Fix: Do not grant geolocation permission to all origins by default; make browser permissions empty unless explicitly requested by the caller.
-
LowSpider checkpoint resume deserializes untrusted data with pickle.loads
scrapling/spiders/checkpoint.py:74
When crawldir is enabled on a spider, CheckpointManager.load() reads checkpoint.pkl and passes its bytes to pickle.loads(). Resuming a crawl from a shared, untrusted, or tampered crawldir executes arbitrary Python code on the user's machine.
Fix: Serialize CheckpointData as JSON (storing URL, method, priority, callback name, JSON-compatible metadata, and hex-encoded seen fingerprints) instead of using pickle.
