T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:42- Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 42–77
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: Highpython def add_blog(self, name: str, url: str, use_rss: bool = True): self.watch_list.append({ 'name': name, 'url': url, 'use_rss': use_rss, }) def _check_rss(self, blog: dict) -> dict: feed = feedparser.parse(blog['url']) if feed.entries: latest = feed.entries[0] return { 'name': blog['name'], 'title': latest.title, 'link': latest.link, 'published': latest.get('published', 'Unknown'), } return None def _check_webpage(self, blog: dict) -> dict: response = requests.get(blog['url'])Technical Analysis
add_blog()accepts an arbitrary URL and stores it without validating its scheme, hostname, resolved address, port, or redirect destination. Both monitoring paths subsequently fetch this caller-controlled URL throughfeedparser.parse()orrequests.get().An attacker who can add or influence a monitored URL can therefore make the process send requests to destinations reachable from the agent host. Potential targets include loopback services, private network addresses, link-local endpoints, cloud instance metadata services, and administrative interfaces that are not externally accessible. DNS rebinding and redirects can also bypass validation if checks are only applied to the initial textual hostname.
The RSS path returns response-derived title, link, and publication fields. Consequently, data obtained from an internal endpoint may be exposed through normal monitoring output when it can be interpreted as a feed.
Attack Path
- An attacker supplies a monitored URL that points to an internal service, a cloud metadata endpoint, or an attacker-controlled redirect.
- The URL is accepted by
add_blog()without validation ...[truncated 1039 chars]
- Remediation
View remediation
Remediation Suggestions
- Accept only explicitly supported schemes, normally
httpsand, if necessary,http. - Enforce a narrowly scoped hostname allowlist when the intended feeds are known.
- Resolve hostnames before connecting and reject loopback, private, link-local, multicast, unspecified, reserved, and cloud metadata address ranges for both IPv4 and IPv6.
- Protect against DNS rebinding by connecting only to a validated resolved address and ensuring the HTTP host and TLS certificate remain correct.
- Disable redirects or validate the scheme, hostname, port, and resolved address of every redirect destination.
- Block nonstandard ports unless they are explicitly required.
- Apply the same policy to both
requestsandfeedparser; preferably retrieve feeds through one hardened HTTP client and pass validated response bytes to the parser. - Avoid returning raw remote fields without output validation and appropriate trust labeling.
- Apply outbound firewall or proxy restrictions as defense in depth, including explicit denial of metadata and internal network ranges.
- Accept only explicitly supported schemes, normally
