T09 · Insecure Skill Coding Practices
- Location
solve-recaptcha.sh:25- Finding
Unescaped Arguments Permit CapMonster JSON Request Manipulation
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi case "$WEBSITE_URL" in http://*|https://*) ;; *) echo "website_url must use HTTP or HTTPS" >&2 exit 1 ;; esac PAYLOAD=$(jq -n \ --arg key "$CAPMONSTER_API_KEY" \ --arg url "$WEBSITE_URL" \ --arg sitekey "$SITEKEY" \ '{ clientKey: $key, task: { type: "RecaptchaV2TaskProxyless", websiteURL: $url, websiteKey: $sitekey } }') RESPONSE=$(curl --fail-with-body -sS \ -X POST https://api.capmonster.cloud/createTask \ -H 'Content-Type: application/json' \ --data-binary "$PAYLOAD") ``` Additional hardening should include: 1. Reject missing API keys before making network requests. 2. Restrict target URLs to `http` and `https`; apply a domain allowlist when automation is intended only for approved sites. 3. Validate site-key length and permitted character format before submission. 4. Use `curl --fail-with-body -sS` and explicitly handle transport and HTTP errors. 5. Confirm that `.taskId`, `.errorId`, and result fields have the expected types before using them. 6. Apply account-side spending limits, balance alerts, and API-key rotation procedures to reduce billing exposure. ]]>
