T09 · Insecure Skill Coding Practices
Error
- Location
- strategies/main.md:11
- Finding
- Unrestricted Feed and Article URL Fetching Enables Server-Side Request Forgery<![CDATA[ ## Vulnerability Details **File Location**: `strategies/main.md:11-20`; related behavior in `knowledge/domain.md:161` and `knowledge/domain.md:199-203` **Vulnerability Type**: Server-Side Request Forgery (SSRF) caused by unrestricted outbound URL fetching and redirect handling **Risk Level**: High ### Vulnerable Code Snippets From `strategies/main.md:11-20`: ```markdown - Enumerate all subscribed feed URLs from the user's feed list - For each feed, execute a conditional HTTP GET request: - Include `If-None-Match` (ETag) and `If-Modified-Since` headers from the previous poll - Set `Accept: application/rss+xml, application/atom+xml, application/xml, text/xml;q=0.9` - Set a 30-second timeout per feed - Process HTTP responses: - IF **304 Not Modified** THEN skip parsing, record successful poll, move to next feed - IF **301 Moved Permanently** THEN update the stored feed URL and process the redirect target - IF **410 Gone** THEN mark the feed as dead, alert the user, and remove from active polling - IF **429 Too Many Requests** THEN read `Retry-After` header, schedule retry, and double the polling interval for this feed ``` From `knowledge/domain.md:161`: ```markdown 5. **Fetch the linked URL** -- fallback when feed only provides a title or minimal snippet ``` From `knowledge/domain.md:199-203`: ```markdown When given a website URL instead of a feed URL, discover feeds by: 1. Check `<link rel="alternate" type="application/rss+xml">` in HTML `<head>` 2. Check `<link rel="alternate" type="application/atom+xml">` in HTML `<head>` 3. Try common paths: `/feed`, `/rss`, `/atom.xml`, `/feed.xml`, `/rss.xml`, `/index.xml`, `/feeds/posts/default` (Blogger) 4. Check `/.well-known/` resources 5. Parse the page for embedded feed links in the body content ``` ### Technical Analysis The Skill instructs the Agent to perform HTTP requests against feed URLs supplied by users, process redirect targets, discover additional URLs from remote HTML, and f ...[truncated 3243 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Restrict supported schemes** - Permit only `https` and, where explicitly necessary, `http`. - Reject `file`, `ftp`, `gopher`, `data`, and other schemes. - Reject URLs containing embedded credentials. 2. **Validate every destination** - Resolve the hostname before connecting. - Block IPv4 and IPv6 loopback, private, link-local, multicast, reserved, unspecified, and carrier-grade NAT ranges. - Explicitly block known cloud metadata destinations. - Apply the same checks to user-supplied feeds, discovered feeds, embedded article links, media URLs, and every redirect target. 3. **Harden redirect processing** - Disable automatic redirect following unless each hop is validated. - Set a small redirect limit. - Reject redirects that change to a forbidden scheme, port, hostname, or address range. - Do not permanently store a redirected feed URL until its destination passes validation. 4. **Mitigate DNS rebinding** - Bind the connection to the address that passed validation. - Revalidate after DNS resolution changes. - Ensure all returned addresses are safe rather than accepting a hostname when only one of several addresses is permitted. 5. **Minimize secondary fetching** - Do not fetch linked article pages by default. - Require explicit user approval or a clearly defined trusted-host policy before following article links. - Treat all feed, article, media, and HTML-discovered URLs as untrusted input. 6. **Apply resource controls** - Limit response size, decompressed size, request count, concurrent requests, and total processing time. - Retain the existing timeout but supplement it with these controls. - Reject malformed or excessively long URLs before issuing requests. 7. **Enforce network isolation** - Route outbound requests through a restricted proxy with deny rules for internal networks and metadata services. - Run the Skill in an environment without access to ...[truncated 477 chars]
