T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_feeds.py:16- Finding
Unrestricted Resource Fetching Enables SSRF and Local Resource Access
- Content
View full analysis
1 else '' max_age = int(sys.argv[2]) if len(sys.argv) > 2 else None keyword = sys.argv[3] if len(sys.argv) > 3 else None if not url: print(json.dumps({'error': 'URL required'})) sys.exit(1) result = fetch_feed(url, max_age, keyword) print(json.dumps(result, indent=2)) ``` ### Technical Analysis The script passes a caller-controlled resource identifier directly to `feedparser.parse()` without validating the scheme, destination host, resolved IP address, redirects, or whether the input is a local path. Depending on the schemes and handlers supported by the installed parser and Python runtime, this can allow: - Requests to loopback services such as `127.0.0.1`. - Requests to private or link-local network addresses. - Access to cloud instance metadata endpoints. - Parsing of local files or paths accessible to the process. - Redirect-based bypasses in which an initially acceptable URL redirects to a restricted destination. Any resulting document that can be interpreted as feed data may be included in the JSON output. The documented scheduling and webhook workflows can subsequently transmit that output to another service. ### Attack Path 1. An attacker, untrusted user, or compromised Agent workflow supplies a malicious feed resource as the first command-line argument. 2. The script forwards the value to `feedparser.parse()` without validation. 3. The parser accesses an internal service, link-local endpoint, or local r ...[truncated 999 chars]- Remediation
View remediation
