T09 · Insecure Skill Coding Practices
- Location
digital_oracle/providers/web.py:386- Finding
Arbitrary URL Fetching Permits Server-Side Request Forgery
- Content
View full analysis
Vulnerability Details
File Location:
digital_oracle/providers/web.py:386-391
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: MediumVulnerable code:
python def fetch_page(self, query: WebPageQuery | str) -> WebPageContent: """Fetch a URL and extract its text content.""" if isinstance(query, str): query = WebPageQuery(url=query) html = self.http_client.fetch(query.url)Technical Analysis
WebSearchProvider.fetch_page()accepts a caller-controlled URL and passes it directly to the HTTP client. The associatedUrllibSearchClient.fetch()implementation usesurllib.request.urlopen()without enforcing an allowed scheme or destination policy.The implementation does not:
- Restrict requests to HTTPS.
- Reject loopback, private, link-local, reserved, or multicast addresses.
- Block known cloud metadata addresses.
- Reject embedded URL credentials.
- Restrict requests to approved financial-data domains.
- Resolve and validate hostnames before connecting.
- Revalidate the destination after HTTP redirects.
Consequently, an attacker who can influence the URL supplied to the Skill may cause the host running the Agent to send requests to services that are inaccessible from the attacker's own network. Automatic redirect handling may also allow an initially public URL to redirect to a prohibited internal destination.
Attack Path
- An attacker submits a financial-analysis request containing or referencing a crafted URL.
- The Agent chooses
WebSearchProvider.fetch_page()to retrieve the referenced page. fetch_page()passes the URL toUrllibSearchClient.fetch()without destination validation.- The HTTP client sends the request from the Agent's network environment.
- The target may be a loopback service, private-network application, or cloud metadata endpoint.
- The response is converted into text and returned as `WebPageCo ...[truncated 963 chars]
- Remediation
View remediation
Remediation Suggestions
- Permit only
httpsURLs and reject unsupported schemes such asfile,ftp,data, andgopher. - Reject URLs containing user-information components such as
username:password@host. - Resolve the hostname before connecting and reject every resolved loopback, private, link-local, reserved, multicast, or unspecified IP address.
- Explicitly block cloud metadata destinations, including link-local metadata addresses and provider-specific metadata hostnames.
- Disable automatic redirects or validate the scheme, hostname, and resolved address at every redirect hop.
- Prefer an explicit allowlist of trusted financial and market-data domains if arbitrary browsing is not essential.
- Apply outbound firewall or proxy rules so application-level validation is not the only defense.
- Limit response sizes and request duration to reduce resource-exhaustion risk.
- Add tests covering IPv4, IPv6, alternative address representations, DNS rebinding scenarios, and public-to-private redirects.
- Permit only
