T09 · Insecure Skill Coding Practices
- Location
scripts/crawl.py:46- Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
[extra_url1 extra_url2 ...]", file=sys.stderr) sys.exit(1) args = sys.argv[1:] deep = "--deep" in args args = [a for a in args if a != "--deep"] root_url = args[0] extra_urls = args[1:] if len(args) > 1 else [] if not root_url.startswith("http"): root_url = "https://" + root_url result = crawl(root_url, extra_urls, deep=deep) print(json.dumps(result, indent=2)) ``` ### Technical Analysis The crawler sends requests to the user-controlled root URL and every user-provided extra URL without validating the URL scheme, destination address, port, or DNS resolution. It also enables `follow_redirects=True` without checking the destination of each redirect. Consequently, the crawler can be instructed to contact: - Loopback services such as `127.0.0.1` or `::1` - RFC1918 private networks - Link-local services and cloud metadata endpoints - Internal DN ...[truncated 1985 chars]- Remediation
View remediation
