T09 · Insecure Skill Coding Practices
- Location
seo-analyze.sh:7- Finding
Unrestricted User-Controlled URL Fetching Enables SSRF and Local Resource Access
- Content
View full analysis
}" HTML=$(curl -sL --max-time 15 -A "Mozilla/5.0 SEO-Analyzer/1.0" "$URL") fi ``` ### Technical Analysis The script accepts a user-controlled URL and passes it directly to `curl` without validating its scheme, destination, resolved IP address, or redirect targets. Consequently, an attacker may cause the host running the skill to request resources that are not normally accessible to the attacker, including: - Loopback services such as `http://127.0.0.1`. - Private-network services. - Link-local cloud metadata endpoints. - Local files through schemes such as `file://`, where supported by the installed `curl`. - A permitted-looking public URL that redirects to an internal destination, because `curl -L` follows redirects without revalidating the target. The script also does not place the `--` end-of-options marker before the user-controlled argument. A value beginning with a hyphen may therefore be interpreted as a `curl` option rather than as a URL. The fetched response is analyzed and selected data is printed in the report, including the title, metadata, canonical URL, heading counts, and keyword statistics. This creates a limited disclosure channel for data obtained from local or internal resources. ### Attack Path 1. An attacker provides a URL pointing to a resource accessible from the Agent host, such as a loopback service, private-network application, or cloud metadata endpoint. 2. Alternatively, the attacker supplies a public URL that redirects to an internal or link-local address. 3. The Agent invokes `seo-analyze.sh` with the attacker-controlled URL as documented by the skill. 4. `curl` accesses the destination using the Agent ...[truncated 971 chars]- Remediation
View remediation
