T09 · Insecure Skill Coding Practices
- Location
url2png.sh:3- Finding
Arbitrary URL Rendering Enables Server-Side Request Forgery
- Content
View full analysis
Vulnerability Details
File Location:
url2png.sh, lines 3-15
Vulnerability Type: Server-Side Request Forgery through unrestricted browser navigation
Risk Level: HighVulnerable Code
bash url="${1:-https://simonwillison.net/2026/Feb/10/showboat-and-rodney}" outdir=${2:-~/Pictures} mkdir -p ${outdir} # cd into outdir, let shot-scraper save with proper name cd ${outdir} # take long screenshot for iPhone by default uvx shot-scraper shot "${url}" \ --browser chromium \ --width 390 \ --retina \ --wait 10000 \ --timeout 30000The resulting file is subsequently returned to the requester according to
SKILL.md, lines 39-43:markdown ## Agent Instructions 1. Execute the `url2png.sh` script. 2. Locate the generated PNG file (default in `~/Pictures` if not specified). 3. Send the file to the user. **Crucial:** To avoid compression or dimension limits (especially on Telegram), send the image as a **document/file** (or ZIP it), do not send as a photo.Technical Analysis
The first command-line argument is passed directly to Chromium without URL-scheme validation, destination filtering, DNS/IP validation, or redirect restrictions. Although shell quoting prevents ordinary command injection through this argument, it does not prevent the browser from requesting attacker-selected network resources.
Consequently, a remote requester may direct the browser to loopback addresses, private network ranges, link-local services, or cloud instance metadata endpoints. The request originates from the system running the skill rather than from the requester. Any rendered response can be captured in a screenshot and returned to the requester.
Redirects and DNS rebinding can also undermine checks performed only on the original hostname. Destination validation must therefore be applied after DNS resolution and again for every redirect.
Attack Path
- An attacker i ...[truncated 1259 chars]
- Remediation
View remediation
Remediation Suggestions
- Restrict accepted schemes to
httpsand, only if required,http. Rejectfile,data,javascript, and all other schemes. - Resolve the destination hostname before navigation and reject every address in loopback, private, link-local, multicast, reserved, and unspecified address ranges for both IPv4 and IPv6.
- Explicitly block cloud metadata addresses and hostnames, including link-local metadata services.
- Revalidate the hostname and resolved IP address after every redirect. Do not rely solely on validation of the initial URL.
- Mitigate DNS rebinding by connecting through a controlled proxy or by enforcing destination policies at the network layer.
- Run Chromium in an isolated container or network namespace with no access to the host network or private infrastructure.
- Apply an outbound allowlist if the intended use permits limiting screenshots to approved public domains.
- Disable browser access to local files and unnecessary browser capabilities.
- Record blocked navigation attempts without logging sensitive URL components or credentials.
- Restrict accepted schemes to
