T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:1
- Finding
- Unrestricted URL Fetching Enables Server-Side Request Forgery## Vulnerability Details **File Location**: `SKILL.md`, line 1 **Vulnerability Type**: Server-Side Request Forgery through unrestricted URL fetching **Risk Level**: High ### Vulnerable Code ```markdown ## Quick Audit 1. web_fetch url pt content. 2. Prompt Ollama (llama3:8b): "Analyze SEO: keywords, meta, headings, img alt, speed est. from HTML. Score 1-10. Fixes." 3. browser/screenshot pt visual (opțional). 4. Report Markdown + score. ``` ### Technical Analysis The skill directs the agent to pass an audit target directly to `web_fetch` without defining any destination validation or network-access restrictions. There are no controls requiring HTTP or HTTPS, resolving and validating the destination IP address, rejecting private or reserved address ranges, or revalidating redirect destinations. Because an SEO audit only requires access to public websites, allowing requests to arbitrary network locations violates the principle of least privilege. Depending on the protections implemented by the underlying tool, an attacker could supply a loopback, private-network, link-local, or cloud metadata URL. DNS rebinding and redirects may also bypass validation if checks occur only before resolution or on the initial URL. ### Attack Path 1. An attacker asks the agent to perform an SEO audit of a specially selected URL. 2. The URL points directly to an internal service, or redirects to a loopback, private, link-local, or cloud metadata address. 3. Following the skill instructions, the agent invokes `web_fetch` for that URL. 4. The fetch tool sends the request from its privileged network environment. 5. Any returned internal content enters the model context for SEO analysis. 6. The generated report may disclose retrieved content to the requester. ### Impact Assessment Successful exploitation could allow access to HTTP services reachable from the agent environment but unavailable to the external requester. The precise scope depends on the fetch tool's network permission ...[truncated 407 chars]
- Remediation
- ## Remediation Suggestions 1. Accept only absolute `http://` and `https://` URLs. 2. Resolve every hostname and reject all loopback, private, link-local, multicast, unspecified, reserved, and documentation address ranges for both IPv4 and IPv6. 3. Explicitly block cloud metadata endpoints, including link-local metadata addresses and provider-specific metadata hostnames. 4. Repeat DNS and IP validation for every connection and redirect destination; do not validate only the original URL. 5. Limit redirect counts and reject redirects to a different trust zone. 6. Prefer an explicit allowlist of public domains when the operational context permits it. 7. Disable forwarding of ambient credentials, cookies, authorization headers, and client certificates. 8. Apply response-size limits, connection and read timeouts, and content-type restrictions. 9. Run the fetcher in an isolated environment with no access to internal networks or metadata services. 10. Require explicit user confirmation and separate authorization for any legitimate private-network audit.
