Back to skill

Security audit

Smart Crawler

Security checks for vulnerabilities and agentic risk

Overview

This crawler is not overtly malicious, but it needs review because it enables broad scraping, anti-detection behavior, unrestricted URL fetching, and unrestricted local output paths without enough guardrails.

Install only in an isolated, low-privilege environment and use it only for targets you are authorized to crawl. Add or require target allowlists, block private and metadata network ranges, constrain all output writes to a dedicated directory, avoid following unvalidated redirects, and pin dependencies before production use.

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/crawler.py:48
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis
str: """获取页面内容""" self._apply_delay() headers = kwargs.pop('headers', self.headers) proxy = self._get_proxy() for attempt in range(self.max_retries): try: response = self.session.get( url, headers=headers, proxies=proxy, timeout=self.timeout, **kwargs ) response.raise_for_status() response.encoding = response.apparent_encoding return response.text except requests.RequestException as e: if attempt == self.max_retries - 1: raise Exception(f"请求失败: {url}, 错误: {e}") time.sleep(2 ** attempt) # 指数退避 return "" ``` #### `scripts/crawler.py:132-157` ```python def download(self, url: str, save_path: str, **kwargs) -> str: """下载文件""" self._apply_delay() proxy = self._get_proxy() response = self.session.get( url, headers=self.headers, proxies=proxy, timeout=self.timeout, stream=True, **kwargs ) response.raise_for_status() with open(save_path, 'wb') as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) return save_path ``` #### `scripts/crawler_engine.py:61-77` ```python def _crawl_static(self, url: str, extract_rules: Dict[str, str]) -> Dict: """静态爬取(使用 requests)""" try: response = self.session.get(url, timeout=30) response.raise_for_status() ...[truncated 5396 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/crawler.py:132
Finding

Caller-Controlled Output Paths Permit Arbitrary File Overwrite

Content
View full analysis
str: """下载文件""" self._apply_delay() proxy = self._get_proxy() response = self.session.get( url, headers=self.headers, proxies=proxy, timeout=self.timeout, stream=True, **kwargs ) response.raise_for_status() with open(save_path, 'wb') as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) return save_path ``` #### `scripts/batch_crawler.py:94-106` ```python def save_results(self, path: str, format: str = 'json'): """保存结果""" import json import pandas as pd if format == 'json': with open(path, 'w', encoding='utf-8') as f: json.dump(self.results, f, ensure_ascii=False, indent=2) elif format == 'csv': df = pd.DataFrame(self.results) df.to_csv(path, index=False) print(f"结果已保存: {path}") ``` #### `scripts/dynamic_crawler.py:96-105` ```python def screenshot(self, url: str, save_path: str, full_page: bool = True): """页面截图""" self._init_browser() page = self.context.new_page() try: page.goto(url, wait_until='networkidle') page.screenshot(path=save_path, full_page=full_page) print(f"截图已保存: {save_path}") finally: page.close() ``` ### Technical Analysis The download, result-export, and screenshot APIs use caller-provided paths directly. They do not: - Restrict writes to an approved output directory. - Reject absolute paths or parent-directory traversal. - Resolve and verify canonical path containment. - detect symbolic links. - Prevent replaceme ...[truncated 1625 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Dependencies and Unverified Browser Downloads Create Supply-Chain Risk

Content
View full analysis
=2.31.0 scrapy>=2.11.0 playwright>=1.40.0 beautifulsoup4>=4.12.0 lxml>=4.9.0 fake-useragent>=1.4.0 selenium>=4.15.0 pandas>=2.0.0 openpyxl>=3.1.0 pymongo>=4.6.0 ``` #### `README.md:16-20` ```bash pip install -r requirements.txt # Playwright 浏览器 playwright install chromium ``` #### `SKILL.md:38-42` ```bash pip install -r requirements.txt playwright install ``` ### Technical Analysis All Python dependencies use minimum-version constraints rather than exact reviewed versions. No lockfile or package hashes are present. Installation can therefore resolve to versions released after this audit, making the installed code materially different from the reviewed dependency set. The instructions also run `playwright install` or `playwright install chromium`, which downloads browser binaries at installation time. The generic command may install more browser components than the Skill requires, and the repository does not document or pin a reviewed browser revision. No evidence was found that the listed package names are typosquatted or intentionally malicious. The issue is that installation is mutable and lacks repository-level integrity enforcement, which expands exposure to compromised upstream releases, unexpected dependency changes, and transitive dependency regressions. ### Attack Path 1. A user follows the documented installation instructions. 2. The package resolver selects the newest versions satisfying the open-ended `>=` constraints, including their current transitive dependencies. 3. Playwright retrieves browser artifacts corresponding to the resolved Playwright installation. 4. A compromised, malicious, or unexpectedly incompatible upstream artifact is installed. 5. D ...[truncated 937 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (33)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README explicitly promotes anti-bot evasion techniques such as proxy pools, request-rate control, and User-Agent rotation, but provides no warning about legal, contractual, privacy, or authorization boundaries. In a reusable agent skill, this lowers friction for misuse against third-party sites and normalizes behavior intended to bypass access controls or site policies.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises code-driven crawling capabilities that inherently require network access and may write files or extracted data, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization and transparency gap: an agent or user cannot easily determine what capabilities the skill is expected to exercise, increasing the risk of overbroad execution or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation promotes anti-detection features like rotating User-Agent values, proxy pools, and request-rate control without warning users about legal, policy, or ethical risks. In context, this is more dangerous because the skill is explicitly designed for web scraping and evasion, which can facilitate bypassing site restrictions, obscuring attribution, and abusive collection behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

User-visible natural-language content in the module, including the title, docstrings, comments, and runtime print messages, is presented in Chinese with no indication of language choice or opt-in. This can violate language/locale policy when a skill imposes a specific language without offering the user an alternative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code performs HTTP fetching via self.crawler.fetch(url), which is a safety-relevant network operation, but this file provides no explicit user-facing disclosure about network access, destination requests, or the handling of fetched content. The surrounding docstrings only describe crawling functionality and do not warn about external requests or potential data/privacy impact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The default Accept-Language header is hard-coded to prefer zh-CN/zh, which imposes a specific locale on all requests made by the skill. This is a natural-language/locale policy concern because users are not offered a language choice or opt-in, and the code does not document a region-specific justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes an intelligent web crawler for enterprise data collection with anti-detection, which clearly justifies fetching web content and extracting data. However, this method saves arbitrary remote responses directly to an arbitrary local path, adding a general file-writing capability beyond the core stated purpose of crawling and extraction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The download method fetches remote content and writes it directly to the provided save_path, but there is no confirmation prompt and no user-facing logging or warning around the file write. The brief docstring only says '下载文件' and does not disclose the safety-relevant behavior of writing remote data to local storage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The default request headers hard-code Accept-Language to prefer zh-CN, which imposes a specific language/locale on all requests. This is a natural-language policy concern because the file does not offer user opt-in or explain why a Chinese locale is required.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The method navigates to arbitrary URLs and can perform user-supplied click, type, and scroll actions, which may transmit system or user-originated data to remote sites. While the docstring describes functionality, it does not warn about the outbound network access or the fact that action text may be sent to third-party pages.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README title and descriptive content are presented in Chinese, which effectively forces a specific language for users reading the skill documentation. There is no indication that this locale choice is optional, user-selectable, or justified as a region-specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The skill description and primary documentation are substantially Chinese-language and do not indicate that users may choose their preferred language or locale. This can be a natural-language policy issue when a skill effectively forces a specific language experience without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code's title strings, docstrings, and all user-visible print output are written in Chinese, which imposes a specific language on users without any opt-in or selection mechanism. The policy explicitly allows locale constraints only when justified or optional, neither of which is present here.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency is specified with a lower-bound only (requests>=2.31.0), which makes builds non-reproducible and may pull in future releases with unknown behavior or vulnerable transitive dependencies. In a security-sensitive crawler that performs network operations, leaving versions unpinned increases supply-chain risk and makes it difficult to verify whether deployed environments are affected by known advisories.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
scrapy>=2.11.0
playwright>=1.40.0
beautifulsoup4>=4.12.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The manifest does not pin requests, and requests has multiple known advisories across versions, so it is impossible to verify from this file whether a safe release is installed. In a crawler that makes outbound HTTP requests and may handle redirects, auth, or .netrc interactions, that uncertainty is security-relevant even though the file alone does not prove a specific vulnerable version is present.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

scrapy>=2.11.0 is unpinned, so installations may resolve to different versions over time, undermining reproducibility and exposing the project to newly introduced vulnerable or incompatible releases. Because this skill is a web crawler and Scrapy is core to request handling, parsing, and redirect behavior, dependency drift is more operationally and security-relevant than in a non-networked tool.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.31.0
scrapy>=2.11.0
playwright>=1.40.0
beautifulsoup4>=4.12.0
lxml>=4.9.0

Unverifiable Dependency: scrapy has 16 known advisory(ies) (GHSA-23j4-mw76-5v7h (Scrapy allows redirect following in protocols other than HTTP); CVE-2025-6176 (Scrapy is vulnerable to a denial of service (DoS) attack due to flaws in brotli ); CVE-2024-1968 (Scrapy leaks the authorization header on same-domain but cross-origin redirects) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
94% confidence
Finding

Scrapy has known advisories in some versions, but the unpinned requirement prevents determining whether the resolved installation is affected. Because Scrapy is a core crawling framework handling requests, redirects, decompression, and headers, unverifiable versioning raises real though low-confidence supply-chain and patch-management risk.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

playwright>=1.40.0 allows unreviewed future versions to be installed, which can introduce security regressions or unexpected browser automation changes. Since this skill uses browser automation for anti-detection crawling, changes in Playwright or bundled browser components may materially affect both attack surface and runtime behavior.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
requests>=2.31.0
scrapy>=2.11.0
playwright>=1.40.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
fake-useragent>=1.4.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

beautifulsoup4>=4.12.0 is not pinned, making builds non-deterministic and complicating assurance about which code is actually deployed. While BeautifulSoup is lower risk than network-facing frameworks, parser changes can still affect data handling and interaction with other libraries in a crawler pipeline.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
requests>=2.31.0
scrapy>=2.11.0
playwright>=1.40.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
fake-useragent>=1.4.0
selenium>=4.15.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
99% confidence
Finding

lxml>=4.9.0 is unpinned despite lxml being a security-relevant parser library with a history of advisories. In a crawler that processes untrusted remote HTML/XML content, failing to pin parser versions makes it harder to ensure that deployed instances consistently include fixes for parsing-related vulnerabilities.

Content

Scanner excerpt · requirements.txt (reported line 5)May include surrounding context.

text
scrapy>=2.11.0
playwright>=1.40.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
fake-useragent>=1.4.0
selenium>=4.15.0
pandas>=2.0.0

Unverifiable Dependency: lxml has 14 known advisory(ies) (CVE-2021-43818 (lxml's HTML Cleaner allows crafted and SVG embedded scripts to pass through); CVE-2014-3146 (lxml Cross-site Scripting Via Control Characters); CVE-2021-28957 (lxml vulnerable to Cross-Site Scripting ) +11 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
96% confidence
Finding

lxml has a history of parser-related security advisories, and the lack of version pinning means the deployed release cannot be verified as patched. This is more dangerous in this skill than in many projects because a web crawler routinely parses untrusted remote content, increasing exposure to parser flaws if an affected version is resolved.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

fake-useragent>=1.4.0 is unpinned, which creates reproducibility and supply-chain uncertainty. Although it is not typically a high-impact dependency by itself, the anti-detection context means the project relies on nuanced runtime behavior that could change unexpectedly across versions.

Content

Scanner excerpt · requirements.txt (reported line 6)May include surrounding context.

text
playwright>=1.40.0
beautifulsoup4>=4.12.0
lxml>=4.9.0
fake-useragent>=1.4.0
selenium>=4.15.0
pandas>=2.0.0
openpyxl>=3.1.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

selenium>=4.15.0 leaves the installed version open-ended, increasing the risk of dependency drift and accidental inclusion of vulnerable or breaking releases. Because Selenium controls browser automation and may interact with remote drivers or grid components, version uncertainty can expand the operational and security attack surface.

Content

Scanner excerpt · requirements.txt (reported line 7)May include surrounding context.

text
beautifulsoup4>=4.12.0
lxml>=4.9.0
fake-useragent>=1.4.0
selenium>=4.15.0
pandas>=2.0.0
openpyxl>=3.1.0
pymongo>=4.6.0

Unverifiable Dependency: selenium has 2 known advisory(ies) (CVE-2022-28108 (Selenium Server (Grid) before 4 allows CSRF because it permits non-JSON content ); CVE-2023-5590 (NULL Pointer Dereference in GitHub repository seleniumhq/selenium prior to 4.14.)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

Selenium has known advisories in some versions, but the requirement is not pinned, so this file cannot establish whether the runtime is safe. Given the browser automation context and possible remote-driver use, lack of verifiable version control creates unnecessary uncertainty around an already complex attack surface.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

pandas>=2.0.0 is unpinned, so different environments may install different versions, reducing reproducibility and certainty around security posture. In this crawler context pandas is likely used for post-processing/export, so the direct exploitability is lower, but dependency hygiene is still important.

Content

Scanner excerpt · requirements.txt (reported line 8)May include surrounding context.

text
lxml>=4.9.0
fake-useragent>=1.4.0
selenium>=4.15.0
pandas>=2.0.0
openpyxl>=3.1.0
pymongo>=4.6.0

Static analysis

No suspicious patterns detected.