T09 · Insecure Skill Coding Practices
- Location
references/code-examples/bria_video_client.sh:119- Finding
API Key Disclosure Through Unvalidated API and Polling Destinations
- Content
View full analysis
&2; return 1 ;; 403) echo "ERROR 403: Billing/quota issue. Visit https://platform.bria.ai/pricing" >&2; echo "$body" >&2; return 1 ;; 413) echo "ERROR 413: Video too large (max resolution 16000x16000)." >&2; return 1 ;; 422) echo "ERROR 422: Invalid combination — Transparent background requires an alpha-capable preset (webm_vp9, mkv_vp9, mov_proresks). Use a solid background_color for other presets. Response: $body" >&2; return 1 ;; 5*) echo "ERROR $http_code: Server error. Try again shortly." >&2; return 1 ;; esac if [ "${http_code:-0}" -ge 400 ] 2>/dev/null; then echo "ERROR $http_code: $body" >&2; return 1 fi # --- Async: poll status_url (video jobs take longer than image jobs) --- status_url=$(printf '%s' "$body" | sed -n 's/.*"status_url" *: *"\([^"]*\)".*/\1/p') if [ -n "$status_url" ]; then i=0 while [ "$i" -lt "$BRIA_POLL_ATTEMPTS" ]; do sleep "$BRIA_POLL_INTERVAL" poll=$(curl -s "$status_url" \ -H "api_token: $BRIA_API_KEY" \ -H "User-Agent: $BRIA_USER_AGENT") ``` ### Technical Analysis The helper places the Bria API key in requests to two destinations that are not validated: 1. `BRIA_API_BASE` may be overridden through the process environment. 2. `status_url` is extra ...[truncated 1655 chars]- Remediation
View remediation
