Back to skill

Security audit

Js Render Scraper

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its web-scraping purpose, but it includes logged-in scraping and anti-bot bypass guidance without enough guardrails.

Install only if you will use it in a contained environment and for sites you are authorized to scrape. Avoid providing real account credentials through these examples unless you control the destination and secret handling, and do not use the proxy, CAPTCHA, or stealth guidance to bypass site controls.

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
references/scraper_example.py:140
Finding

JavaScript Injection Through an Unsafely Interpolated Data Key

Content
View full analysis
str: """Extract content based on configured method""" if config.javascript_data_key: # Extract JavaScript global data return self.page.evaluate( f"() => JSON.stringify(window.{config.javascript_data_key} || null)" ) ``` ### Technical Analysis The `javascript_data_key` configuration value is interpolated directly into JavaScript source code passed to Playwright's `page.evaluate`. The implementation assumes that this value is a trusted JavaScript property name, but it performs no syntax or identifier validation. A caller able to control this configuration field can provide JavaScript syntax instead of a simple property name. The resulting expression is evaluated in the context of the loaded web page. Separating untrusted data from executable source is required even when the JavaScript runs inside a browser context. The vulnerable operation can expose any data available to page JavaScript, including DOM content, application state, non-HttpOnly tokens, and browser storage associated with the loaded origin. Injected code may also make authenticated same-origin requests or send data to an external endpoint, subject to browser security controls. ### Attack Path 1. An attacker controls or influences `ScrapeConfig.javascript_data_key`. 2. The attacker provides a value containing JavaScript syntax rather than a valid property key. 3. `_extract_content` embeds that value into the function source with an f-string. 4. Playwright executes the constructed source through `page.evaluate`. 5. The injected expression accesses page data, performs requests with the page's authenticated context, alters the DOM, or transmits accessible information. 6. The scr ...[truncated 842 chars]
Remediation
View remediation
JSON.stringify(window[key] ?? null)", config.javascript_data_key, ) ``` Apply the following additional controls: 1. If only top-level properties are supported, enforce a conservative identifier allowlist such as `^[A-Za-z_$][A-Za-z0-9_$]*$`. 2. If nested paths are required, split the input into components, validate every component, and traverse the object without constructing JavaScript source. 3. Reject keys containing parentheses, brackets, quotes, semicolons, whitespace, operators, or other executable syntax. 4. Treat extraction configuration as untrusted whenever it originates from users, remote jobs, or generated agent input. 5. Add tests using malicious syntax to confirm that configuration values cannot escape the data boundary. 6. Use a restricted browser context and avoid loading sensitive authenticated sessions unless they are necessary for the task. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/scraper_example.py:92
Finding

Unrestricted Browser Navigation Enables Server-Side Request Forgery

Content
View full analysis
ScrapeResult: """Execute scraping with given configuration""" result = ScrapeResult( url=config.url, timestamp=datetime.now().isoformat(), status="pending" ) try: # Navigate to page self.page.goto(config.url, wait_until="networkidle") ``` The same behavior is present in the infinite-scroll helper: ```python def scrape_infinite_scroll(url: str, item_selector: str, max_scrolls: int = 10) -> List[dict]: """Scrape items from infinite scroll page""" items = [] with JSRenderScraper() as scraper: scraper.page.goto(url, wait_until="networkidle") ``` The login helper navigates to both a configured login URL and a caller-provided target URL: ```python def scrape_with_login(url: str, login_config: dict, username: str, password: str) -> str: """Scrape page requiring login""" with JSRenderScraper() as scraper: # Navigate to login page scraper.page.goto(login_config["login_url"], wait_until="networkidle") # Fill credentials scraper.page.fill(login_config["username_input"], username) scraper.page.fill(login_config["password_input"], password) scraper.page.click(login_config["submit_button"]) scraper.page.wait_for_load_state("networkidle") # Navigate to target page scraper.page.goto(url, wait_until="networkidle") ``` The Shadow DOM helper is affected as well: ```python def scrape_shadow_dom(url: str, shadow_host_selector: str) -> str: """Scrape content from S ...[truncated 2596 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
references/scraper_example.py:66
Finding

Unpinned Playwright Installation Guidance Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个用于动态网页抓取的技能,但提供的代码完全没有网络访问、浏览器控制、登录处理、页面渲染或内容提取逻辑。相反,它只读取本地文件(SKILL.md、_meta.json)并检查目录结构与格式规范。这不是抓取技能的支持性实现细节,而是与声明的核心用途 materially different 的独立校验工具,因此应判定为明显不匹配。

Content

No source excerpt is available for this finding.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

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

md
---
AIGC:
    ContentProducer: Minimax Agent AI
    ContentPropagator: Minimax Agent AI
    Label: AIGC
    ProduceID: "00000000000000000000000000000000"
    PropagateID: "00000000000000000000000000000000"
    ReservedCode1: 3044022028523a0cb66b8d83293f741645ed990b8b53fbbcc4fdb5bfe1c3155c52a65ca602204f9d1cc18247d54fb3eee588805aad50197317528a5f99955b7bed7ff218faa1
    ReservedCode2: 3045022100b347e607d77b922f0aa9705ef58511fce84f7d231b705130af0cfe3c0eb28db3022043001c1760b6124edbda628200170db404f267f4ab49ff6965f1aaf1184c0587
description: 爬取需要 JavaScript 渲染的动态网页内容。当用户要求抓取 SPA、React/Vue 应用、无限滚动页面、需要登录的页面或任何依赖 JS 动态加载内容的网站时使用。支持使用 Playwright 进行浏览器自动化抓取。
name: js-render-scraper
-

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/validate_skill.py (reported line 100)May include surrounding context.

python
errors.append(f"Invalid folder name '{skill_path.name}'. Use lowercase, numbers, and hyphens only")

    # Check for unintended files
    forbidden = [".pyc", "__pycache__", ".env", ".git"]
    for item in skill_path.rglob("*"):
        if item.is_file():
            for f in forbidden:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill includes executable code examples that can read and write local data during scraping workflows, but the manifest does not declare any tool scope or permissions boundaries. In an agent environment, missing explicit scope increases the chance of over-broad tool access and makes operator review harder.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill provides a pattern for scraping logged-in pages by handling usernames and passwords, but it does not address secret storage, session handling, data minimization, or user privacy. In agent use, this can lead to credential leakage, unauthorized account access, and collection of sensitive account-scoped content.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation explicitly recommends anti-bot evasion methods including proxy pools, CAPTCHA-solving services, and stealth masking. These capabilities materially expand the skill from normal scraping into bypassing access controls and detection mechanisms, which can facilitate unauthorized collection at scale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The anti-bot evasion section lacks warnings about the legal, ethical, and security implications of proxy use, CAPTCHA solving, and stealth fingerprint masking. Without those guardrails, an operator may treat these bypass techniques as normal defaults, increasing the risk of misuse and policy violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The login scraping helper automates credential submission and authenticated browsing without any guardrails around destination trust, secret handling, or user disclosure. In a skill designed to scrape JS-rendered sites, this increases risk because users may be encouraged to provide credentials to arbitrary sites, enabling phishing-style misuse, credential exposure, or unauthorized access if the function is used carelessly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The save_result method writes output to an arbitrary filepath, but the code provides no confirmation prompt, logging, or warning comment/docstring beyond the generic 'Save result to JSON file'. For code files, file writes should have some visible disclosure unless already clearly warned elsewhere, which is not evident in this file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.