T09 · Insecure Skill Coding Practices
- Location
SKILL.md:49- Finding
Unrestricted fetching of attacker-supplied discovery URLs enables SSRF
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 49–62, 113, and 131
Vulnerability Type: Server-Side Request Forgery through untrusted sitemap, robots.txt, and redirect targets
Risk Level: MediumVulnerable Instructions
markdown Fetch `https://<domain>/sitemap.xml`. If it is a sitemap *index* (contains `<sitemap>` entries pointing at other sitemap files), fetch each referenced sitemap and union their URL lists. Also try `https://<domain>/sitemap_index.xml` if the first returns nothing.markdown Fetch `https://<domain>/robots.txt`. Note: - Any `Sitemap:` directives not already tried in 1a — fetch those too. - Any `Disallow:` paths containing the signal words above. A disallowed path is not crawled by search engines, but it is not access-controlled — fetch it directly in Step 2 like any other candidate.markdown Union the URLs from 1a–1d, deduplicated by normalized URL (strip trailing slashes, fragments, and tracking query parameters).bash curl -sL -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" "<URL>" -o /tmp/page.htmlTechnical Analysis
The Skill instructs the Agent to fetch sitemap locations supplied by a website, add discovered URLs to a candidate set, and retrieve every candidate with
curl -L. It does not require discovered URLs to remain on the user-authorized origin, restrict URL schemes, reject loopback/private/link-local/reserved addresses, or validate redirect destinations.The base website is external and potentially attacker-controlled. Its sitemap index,
Sitemap:directives, page links, or HTTP redirects can therefore cause the Agent to issue requests to a different trust zone. The-Loption compounds this issue by automatically following redirects without validating each hop.This crosses the authorization boundary be ...[truncated 1614 chars]
- Remediation
View remediation
Remediation Suggestions
- Restrict all retrievals to
httpandhttps. - Require sitemap references, discovered links, and candidate pages to remain on the user-authorized origin by default.
- Require explicit user approval before contacting a different origin.
- Resolve hostnames before every request and reject loopback, private, link-local, multicast, unspecified, and reserved address ranges for both IPv4 and IPv6.
- Disable automatic redirects or validate the scheme, hostname, resolved address, and origin of every redirect hop before following it.
- Re-resolve and revalidate destinations at connection time to mitigate DNS rebinding and time-of-check/time-of-use issues.
- Apply the same validation to sitemap indexes,
Sitemap:directives, page links, and path-derived candidates. - Prevent responses from rejected or non-authorized origins from being read, classified, or copied into output manifests.
- Prefer a constrained retrieval helper that enforces these policies instead of issuing unrestricted
curl -Lcommands.
- Restrict all retrievals to
