T09 · Insecure Skill Coding Practices
- Location
web-info.sh:47- Finding
Arbitrary URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
/dev/null) ``` ### Technical Analysis The URL validation only verifies that the supplied string begins with `http://` or `https://`. It does not parse or canonicalize the URL, restrict destination ports, resolve and validate the destination address, or reject loopback, private, link-local, reserved, and cloud metadata address ranges. The `-L` option instructs `curl` to follow redirects. Consequently, validating only the initial URL would remain insufficient even if initial-host validation were added: a public endpoint could redirect the request to an internal destination. Every redirect target must be independently validated. The request originates from the host running the skill and therefore has access to any HTTP(S) endpoint reachable from that environment, rather than only endpoints reachable by the caller. ### Attack Path 1. An attacker or untrusted caller supplies a URL such as a loopback address, an RFC1918 address, an internal hostname, or a public endpoint that redirects to one. 2. The argument parser accepts the URL because it starts with `http://` or `https://`. 3. `curl -L` issues the request from the Agent host and follows any redirects without destination validation. 4. The script parses the response and exposes selected response content, including titles, descriptions, headers, links, and statistics. 5. The attacker uses the results to enumerate internal services or retrieve information from unauthenticated internal endpoints. ### Impact Assessment An attacker can make HTTP(S) requests within the network context of the Agent host. The potential scope includes: - Loopback services bound only to ...[truncated 581 chars]- Remediation
View remediation
