T09 · Insecure Skill Coding Practices
- Location
scripts/opml-parse.sh:33- Finding
OPML-Controlled Server-Side Request Forgery Through Feed URLs and Redirects
- Content
View full analysis
/dev/null) # Validate URL scheme — only allow http/https to prevent SSRF case "$FEED_URL" in http://*|https://*) ;; *) warn "Skipping non-HTTP feed URL: $FEED_URL" continue ;; esac # Fetch the RSS/Atom feed with timeout FEED_XML=$(curl -sf --max-time 10 -L "$FEED_URL" 2>/dev/null) || { warn "Could not fetch feed: $FEED_TITLE ($FEED_URL)" continue } ``` ### Technical Analysis The OPML `xmlUrl` attribute is attacker-controlled and is passed to `curl` after validation of only the textual URL scheme. Allowing `http://` and `https://` does not prevent SSRF. The implementation does not reject: - Loopback destinations such as `127.0.0.1` and `::1` - RFC1918 private networks - Link-local addresses - Cloud metadata services - Reserved or multicast address ranges - Internal DNS names - DNS names that resolve or rebind to internal addresses - Unexpected destination ports The `-L` option instructs `curl` to follow redirects. Even if the initial address is public, a public endpoint can redirect the request to an internal service, and the redirected destination is not revalidated. Fetching remote RSS feeds is necessary for the declared functionality, but unrestricted access to arbitrary HTTP destinations exceeds the minimum network privileges required to retrieve ordinary public feeds. ### Attack Path 1. An attacker supplies or convinc ...[truncated 1705 chars]- Remediation
View remediation
