T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/fetch_rss.py:27- Finding
Unrestricted URL Fetching Enables SSRF and Local Resource Access
- Content
View full analysis
[cache_dir]") sys.exit(1) feed_url = sys.argv[1] cache_dir = sys.argv[2] if len(sys.argv) > 2 else "/tmp/camelcamelcamel" cache_file = os.path.join(cache_dir, "cache.json") # Fetch feed xml_content = fetch_rss(feed_url) ``` ### Technical Analysis The script passes an untrusted command-line value directly to `urllib.request.urlopen()` without validating the URL scheme, hostname, port, credentials, resolved address, or redirect destination. Although the skill is intended exclusively for CamelCamelCamel HTTPS feeds, the implementation does not enforce that restriction. An attacker who can influence the command-line argument can cause the process to request internal HTTP services. Depending on the URL handlers available in the runtime, a `file://` URL may also read a local file accessible to the process. Retrieved content is parsed as XML, and values from `title`, `link`, `description`, and `pubDate` elements can subsequently be emitted in JSON. Consequently, XML-formatted internal responses or local files may be partially disclosed through standard output. ### Attack Path 1. The attacker gains control over, or convinces a user to configure, the feed URL argument. 2. The attacker supplies an internal URL such as an address on a loopback, private, or link-local networ ...[truncated 966 chars]- Remediation
View remediation
