T09 · Insecure Skill Coding Practices
- Location
audit.sh:44- Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
/dev/null || echo "000") ``` Additional requests are derived from the untrusted target host: ```bash DOMAIN=$(echo "$TARGET_URL" | sed -E 's|https?://([^/]+).*|\1|') PROTOCOL=$(echo "$TARGET_URL" | sed -E 's|(https?)://.*|\1|') BASE_URL="${PROTOCOL}://${DOMAIN}" ROBOTS_URL="${BASE_URL}/robots.txt" SITEMAP_URL="${BASE_URL}/sitemap.xml" ``` ```bash ROBOTS_STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$ROBOTS_URL" 2>/dev/null || echo "000") ROBOTS_CONTENT=$(curl -s --max-time 10 "$ROBOTS_URL" 2>/dev/null || echo "") ``` ```bash SITEMAP_STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$SITEMAP_URL" 2>/dev/null || echo "000") SITEMAP_CONTENT=$(curl -s --max-time 15 "$SITEMAP_URL" 2>/dev/null || echo "") if [[ "$SITEMAP_STATUS_CODE" == "404" ]]; then # Try common alternatives SITEMAP_ALTS=( "${BASE_URL}/sitemap-index.xml" "${BASE_URL}/sitemap_index.xml" "${BASE_URL}/sitemap/index.xml" ) FOUND_SITEMAP="" for ALT in "${SITEMAP_ALTS[@]}"; do if [[ $(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$ALT" 2>/dev/null || echo "000") == "200" ]]; then FOUND_SITEMAP="$ALT" break fi done ``` ### Technical Analysis The script accepts an arbitrary user-provided URL and only verifies that its textua ...[truncated 2445 chars]- Remediation
View remediation
