T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:60- Finding
Unrestricted URL Requests Enable Server-Side Request Forgery
- Content
View full analysis
/dev/null) || code="ERROR" if [ "$code" = "000" ]; then code="TIMEOUT" fi # If we got a valid response (not timeout/error), stop retrying if [ "$code" != "TIMEOUT" ] && [ "$code" != "ERROR" ]; then break fi attempt=$((attempt + 1)) done echo "$code" } ``` An example input path is: ```bash cmd_check() { local url="${1:?Usage: link-checker check }" echo "Checking: ${url}" local code code=$(_check_url "$url") local icon icon=$(_status_icon "$code") local label label=$(_status_label "$code") echo " ${icon} ${code} — ${label}" _record "$url" "$code" } ``` ### Technical Analysis The script passes user-supplied or document-extracted URLs directly to `curl` without validating the URL scheme, resolved destination address, port, or redirect destination. The `-L` option follows redirects automatically, also without applying destination restrictions after each redirect. Consequently, the URL checker can be made to initiate requests from the host running the Skill to destinations that an external attacker might not otherwise be able t ...[truncated 2047 chars]- Remediation
View remediation
