T09 · Insecure Skill Coding Practices
- Location
scripts/check.sh:9- Finding
Unrestricted Outbound Requests Enable Server-Side Request Forgery
- Content
View full analysis
}" CURL_OUTPUT=$(curl --silent --show-error --max-time 10 \ --write-out "%{http_code}|%{time_total}" \ --output /dev/null \ "$URL" 2>&1) ``` ```bash # scripts/alert.sh WEBHOOK_URL="${ALERT_WEBHOOK_URL:-}" if [ -n "$WEBHOOK_URL" ]; then payload=$(build_webhook_payload) response=$(curl --silent --max-time 10 \ -H "Content-Type: application/json" \ -d "$payload" \ "$WEBHOOK_URL" 2>&1) if [ $? -eq 0 ]; then echo "Alert sent to webhook for $url" else echo "Failed to send webhook alert: $response" >&2 fi fi ``` ### Technical Analysis Both scripts pass externally configurable destinations directly to `curl`. The monitoring URL is accepted as a positional argument, while the webhook destination is read from `ALERT_WEBHOOK_URL`. Neither path validates the URL scheme, hostname, resolved address, port, or destination network. Consequently, a party able to influence script arguments or environment configuration can direct requests toward resources reachable from the agent host, including: - Loopback services such as `127.0.0.1` or `[::1]`. - Private network services. - Link-local addresses and cloud metadata endpoints. - Internal administrative interfaces. - Unexpected protocols supported by the installed curl build. The health-check response body is discarded, which limits direct content disclosure, but HTTP status, timing, and success or failure can still reveal service availability. Requests may also trigger state-changing behavior if an internal endpoint performs actions on a GET request. The webhook path is more dangerous because it sends an attacker-influenced HTTP POST body. ### Attack Path 1. An attacker causes the skill to check ...[truncated 1152 chars]- Remediation
View remediation
