T09 · Insecure Skill Coding Practices
- Location
SKILL.md:28- Finding
Unrestricted User-Controlled URL Fetching Enables SSRF
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 28-29, 33, and 45-48
Vulnerability Type: Server-Side Request Forgery caused by insufficient URL validation
Risk Level: HighVulnerable Code
markdown 1. **Parse target** from `$ARGUMENTS`. - If URL (starts with `http`): use directly. 2. **Fetch the page** via WebFetch. 3. **Check infrastructure files:** - Fetch `{origin}/sitemap.xml` — exists? Valid XML? Page count? - Fetch `{origin}/robots.txt` — exists? Disallow rules? Sitemap reference? - Fetch `{origin}/favicon.ico` — exists?Technical Analysis
The skill accepts a user-controlled target when its value merely starts with
httpand directs the agent to fetch it usingWebFetch. It then derives and requests three additional resources from the same origin.A prefix check does not establish that a destination is safe. The instructions do not reject:
- Loopback destinations such as
127.0.0.1or[::1] - Private or reserved network ranges
- Link-local addresses and cloud instance metadata endpoints
- URLs containing embedded credentials
- Hostnames that resolve to restricted addresses
- Redirects that lead to restricted destinations
- Nonstandard ports exposing internal administrative services
Consequently, the agent's network position can potentially be used as an SSRF proxy. Exploitability and accessible scope depend on the protections implemented by the underlying
WebFetchtool and the runtime's egress policy.Attack Path
- An attacker invokes the skill with an HTTP or HTTPS URL targeting an internal, loopback, link-local, or otherwise restricted service.
- The skill accepts the input because it starts with
http. - The agent requests the supplied URL through
WebFetch. - The workflow may issue additional requests for
/sitemap.xml,/robots.txt, and/favicon.icoon that origin. - If network-layer protections do not block the destination, the requests reach services accessible from th ...[truncated 884 chars]
- Loopback destinations such as
- Remediation
View remediation
Remediation Suggestions
- Parse targets with a standards-compliant URL parser instead of checking only the string prefix.
- Permit only
httpsby default and reject unsupported schemes, malformed URLs, embedded credentials, and unnecessary nonstandard ports. - Resolve the hostname before every request and reject loopback, private, link-local, multicast, reserved, unspecified, and other non-public IP ranges for both IPv4 and IPv6.
- Protect against DNS rebinding by binding requests to validated resolution results or revalidating the actual connection destination.
- Disable redirects where possible. Otherwise, parse, resolve, and validate every redirect destination before following it.
- Apply the same validation to the initial page and all derived resources, including
sitemap.xml,robots.txt, andfavicon.ico. - Enforce network-level egress controls so the fetch runtime cannot access internal networks or metadata services.
- Set strict request timeouts, response-size limits, redirect limits, and content-type restrictions.
- Avoid including sensitive fetched content in reports; expose only the minimum metadata required for the SEO audit.
- If legitimate private-site audits are required, provide a separate explicitly authorized mode with destination allowlisting and clear user confirmation.
