Back to skill

Security audit

Website Screenshot Tool

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but its browser automation and file-writing controls are too broad for safe default use.

Install only if you are comfortable running browser automation in an isolated environment. Avoid capturing private, localhost, cloud metadata, or internal-network URLs; keep screenshots and exported history protected; constrain output paths to a dedicated directory; pin dependencies; and remove the Selenium --no-sandbox fallback before using it with untrusted sites.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/website_screenshot.py:37
Finding

Unrestricted Browser Navigation Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: scripts/website_screenshot.py, lines 37-38, 65-89, and 94-109
Vulnerability Type: Server-Side Request Forgery through unrestricted URL navigation
Risk Level: High

Vulnerable Code

python
if not url.startswith(('http://', 'https://')):
    url = 'https://' + url

result = self._capture_with_playwright(
    url, output_path, full_page,
    width or self.default_width,
    height or self.default_height,
    delay
)
python
def _capture_with_playwright(self, url: str, output_path: str, full_page: bool,
                              width: int, height: int, delay: int) -> bool:
    """Use Playwright to capture a screenshot."""
    try:
        from playwright.sync_api import sync_playwright

        with sync_playwright() as p:
            browser = p.chromium.launch()
            page = browser.new_page(viewport={"width": width, "height": height})
            page.goto(url, wait_until="networkidle")

            if delay > 0:
                time.sleep(delay)

            if full_page:
                page.screenshot(path=output_path, full_page=True)
            else:
                page.screenshot(path=output_path)

            browser.close()
            return True

    except ImportError:
        return self._capture_with_selenium(
            url, output_path, full_page, width, height, delay
        )
    except Exception as e:
        print(f"Playwright error: {e}")
        return False
python
def _capture_with_selenium(self, url: str, output_path: str, full_page: bool,
                            width: int, height: int, delay: int) -> bool:
    try:
        from selenium import webdriver
        from selenium.webdriver.chrome.options import Options
        from selenium.webdriver.chrome.service import Service

        chrome_options = Options()
        chrome_options.add_argument("--he
...[truncated 2634 chars]
Remediation
View remediation

Remediation Suggestions

  1. Permit only explicitly supported schemes, normally HTTPS and optionally HTTP.
  2. Parse the URL and reject malformed URLs, embedded credentials, unexpected ports, and missing hostnames.
  3. Resolve the hostname before navigation and reject every address in loopback, private, link-local, multicast, reserved, and unspecified ranges for both IPv4 and IPv6.
  4. Explicitly block cloud metadata destinations, including link-local metadata addresses and provider-specific metadata hostnames.
  5. Revalidate the destination after DNS resolution and at every redirect. Do not rely solely on validation of the initial URL.
  6. Prefer an explicit domain allowlist when the expected screenshot targets are known.
  7. Apply network-level egress controls to the browser container so that validation bypasses cannot reach internal networks.
  8. Run browser workloads in an isolated, unprivileged container with no access to sensitive host services.
  9. Add tests for loopback addresses, private IPv4 and IPv6 addresses, alternate IP representations, DNS rebinding, link-local addresses, and public-to-private redirects.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/website_screenshot.py:40
Finding

Unsanitized Output Names Permit Path Traversal and Arbitrary PNG Placement

Content
View full analysis

Vulnerability Details

File Location: scripts/website_screenshot.py, lines 40-52, 142-164, and 168-177
Vulnerability Type: Path traversal through attacker-controlled output filenames
Risk Level: Medium

Vulnerable Code

python
if output_name is None:
    domain = urlparse(url).netloc.replace('.', '_')
    output_name = f"{domain}_{int(time.time())}"

output_path = os.path.join(self.output_dir, f"{output_name}.png")

result = self._capture_with_playwright(
    url, output_path, full_page,
    width or self.default_width,
    height or self.default_height,
    delay
)

The responsive and comparison methods also propagate output names into the vulnerable sink:

python
for device in devices:
    name = f"{output_name or urlparse(url).netloc}_{device['name']}"
    result = self.capture(
        url, output_name=name,
        width=device["width"], height=device["height"]
    )
python
shot1 = self.capture(url1, output_name=f"{output_name}_before")
shot2 = self.capture(url2, output_name=f"{output_name}_after")

Technical Analysis

The caller-controlled output_name is interpolated into a filename and passed directly to os.path.join. The code does not reject path separators, parent-directory components, or absolute paths, and it does not verify the normalized destination against the configured output directory.

A value containing ../ can therefore escape self.output_dir. On platforms where the supplied value is treated as an absolute path, os.path.join can also discard the intended base directory. Playwright or Selenium subsequently writes the screenshot to the resulting path.

The .png suffix limits the final filename extension, but it does not prevent creation or replacement of PNG-named files elsewhere in the filesystem.

Attack Path

  1. An attacker invokes capture, capture_responsive, or compare and controls output_name.
  2. Th ...[truncated 943 chars]
Remediation
View remediation

Remediation Suggestions

  1. Treat output_name strictly as a filename component rather than a path.
  2. Reject absolute paths, parent-directory components, path separators, null bytes, and platform-specific alternate separators.
  3. Apply a conservative allowlist such as ASCII letters, digits, underscores, and hyphens.
  4. Generate server-controlled random filenames where caller-selected names are unnecessary.
  5. Resolve both the output directory and candidate path before writing, then verify that the candidate remains beneath the resolved output directory.
  6. Reject the operation if the containment check fails.
  7. Consider exclusive file creation or an explicit overwrite policy to prevent unintended replacement of existing screenshots.
  8. Apply the same sanitization to names derived in responsive capture and comparison operations.
  9. Run the process with write access limited to a dedicated screenshot directory.
  10. Add tests covering ../, nested separators, absolute paths, symbolic links, platform-specific paths, and existing destination files.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/website_screenshot.py:102
Finding

Selenium Fallback Opens Untrusted Websites with the Chromium Sandbox Disabled

Content
View full analysis

Vulnerability Details

File Location: scripts/website_screenshot.py, lines 87-89 and 94-121
Vulnerability Type: Unsafe browser isolation configuration
Risk Level: Medium

Vulnerable Code

python
except ImportError:
    # Playwright is unavailable, so use Selenium as a fallback.
    return self._capture_with_selenium(
        url, output_path, full_page, width, height, delay
    )
python
def _capture_with_selenium(self, url: str, output_path: str, full_page: bool,
                            width: int, height: int, delay: int) -> bool:
    try:
        from selenium import webdriver
        from selenium.webdriver.chrome.options import Options
        from selenium.webdriver.chrome.service import Service

        chrome_options = Options()
        chrome_options.add_argument("--headless")
        chrome_options.add_argument("--no-sandbox")
        chrome_options.add_argument(f"--window-size={width},{height}")
        chrome_options.add_argument("--disable-gpu")

        driver = webdriver.Chrome(options=chrome_options)
        driver.get(url)

        if delay > 0:
            time.sleep(delay)

        if full_page:
            total_height = driver.execute_script(
                "return document.body.scrollHeight"
            )
            driver.set_window_size(width, total_height)
            time.sleep(0.5)

        driver.save_screenshot(output_path)
        driver.quit()
        return True

Technical Analysis

The Selenium fallback explicitly launches Chromium with --no-sandbox and then navigates to caller-selected websites. The Chromium sandbox is a major defense-in-depth boundary that restricts the capabilities of compromised renderer processes.

Disabling it does not by itself create a browser exploit, but it materially increases the impact of a browser-engine vulnerability triggered by malicious web content. An attacker would no l ...[truncated 1398 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the --no-sandbox Chromium argument.
  2. Ensure Chromium is launched as a dedicated, non-root operating-system user so its normal sandbox can function.
  3. If deployment constraints prevent sandboxed Chromium from starting, correct the host or container configuration rather than disabling the sandbox.
  4. Run each browser task in a disposable, hardened container or equivalent isolation boundary.
  5. Remove unnecessary Linux capabilities and apply restrictive seccomp, filesystem, process, and network policies.
  6. Do not mount credentials, sensitive host directories, or privileged sockets into the browser environment.
  7. Keep Chromium, Selenium, and Playwright patched and pinned to reviewed versions.
  8. Apply destination filtering and network egress restrictions because browser sandboxing does not prevent server-side request forgery.
  9. Add a deployment test that verifies the browser refuses to run when sandbox protection is unexpectedly unavailable.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (18)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file describes behaviors that can affect user data and privacy, including capturing website contents, periodic monitoring, and exporting capture history to JSON. The description does not warn users that screenshots and exported metadata may store sensitive page content or that scheduled monitoring repeatedly accesses target sites.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and demonstrates both outbound network access to arbitrary URLs and local file-writing for screenshots/history, but it does not declare any explicit tool scope or permissions. That makes the capability boundary unclear to reviewers and users, increasing the risk of unintended SSRF-style access to internal resources, unexpected persistence of captured data, or misuse of scheduled automation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description and section content are presented bilingually/multilingually, but the file does not indicate whether the skill will communicate in a user-selected language or whether this locale choice is intentional. Per policy, language behavior should be optional or clearly documented rather than implicitly forced.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill description omits important safety warnings even though the tool can fetch user-supplied URLs and run recurring scheduled captures. In this context, missing disclosure can lead users to trigger network requests against sensitive/internal endpoints or leave unattended jobs running, which raises operational and privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file includes user-facing natural-language comments in Chinese (e.g., '基础截图') without any indication that language choice is optional or configurable. This can violate a language/locale policy that requires offering a user choice rather than implicitly enforcing one language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This line contains another Chinese-only comment ('全页面截图'), reinforcing that the file's instructional natural language is fixed to one locale without documenting a justified region-specific scope. Under the policy, locale-specific language should be optional or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The comment on this line is written only in Chinese, which imposes a locale assumption for readers of the skill file. No justification or opt-in mechanism is present to explain why this language restriction is necessary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This comment is another instance of Chinese-only natural language in a general-purpose example file. Because the file does not offer a language choice or document a region-specific purpose, it may conflict with language/locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The comparison demo comment is written solely in Chinese despite the rest of the example being generally applicable. This creates a locale-specific instruction style without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This line contains a Chinese-only comment for a general scheduling operation. The file does not state that it is intended only for Chinese-speaking users, so the locale restriction appears undocumented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The comment here continues the use of a single non-default locale without user choice or justification. In a shared example skill file, this can be a natural-language policy concern rather than a code defect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

These comments are also written only in Chinese and therefore maintain an implicit locale requirement throughout the example file. No region-specific rationale or language selection is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The final cleanup comment is another natural-language instance that assumes Chinese comprehension without any explicit locale justification. This is consistent with a language policy violation pattern across the file.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower-bound only (playwright>=1.40.0), which allows future unreviewed versions to be installed and can lead to non-reproducible builds or accidental intake of a compromised or breaking release. In a browser automation tool that interacts with external websites, supply-chain drift increases security and reliability risk even if no specific Playwright CVE is cited here.

Content

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

text
playwright>=1.40.0
selenium>=4.15.0
pytest>=7.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
99% confidence
Finding

selenium>=4.15.0 is unpinned, so installs may resolve to different versions over time, including versions with newly disclosed vulnerabilities or unexpected behavior. Because this skill automates web browsing and may drive browsers against untrusted content, dependency uncertainty is more dangerous than in a purely local utility.

Content

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

text
playwright>=1.40.0
selenium>=4.15.0
pytest>=7.0.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
93% confidence
Finding

The manifest does not pin Selenium, and known advisories exist for some Selenium releases, so the actual installed version may be affected without visibility. This is particularly relevant for a website screenshot automation skill because browser-driving infrastructure often handles untrusted web content and can expose services or CI runners to elevated risk if a vulnerable Selenium version is pulled.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

pytest>=7.0.0 is also unpinned, which makes builds non-deterministic and can introduce vulnerable or incompatible versions during installation. While pytest is typically a development/test dependency, it still expands the supply-chain attack surface if installed in CI or production-like environments.

Content

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

text
playwright>=1.40.0
selenium>=4.15.0
pytest>=7.0.0

Unverifiable Dependency: pytest has 2 known advisory(ies) (CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
86% confidence
Finding

The manifest leaves pytest unpinned despite known advisories in some versions, so the environment could resolve to an affected release. The risk is somewhat reduced because pytest is generally used for testing rather than runtime, but it still matters in CI pipelines or developer environments where vulnerable tooling can be abused.

Content

No source excerpt is available for this finding.