T09 · Insecure Skill Coding Practices
- Location
scripts/transcribe.sh:69- Finding
Unrestricted API Base URL Can Expose the API Key and Audio Data
- Content
View full analysis
&2 exit 2 fi target="$out" tmp="" if [[ "$json_output" == "0" && ( "$request_format" == "json" || "$request_format" == "diarized_json" ) ]]; then tmp="$(mktemp)" trap '[[ "$tmp" == "" ]] || rm -f "$tmp"' EXIT target="$tmp" fi curl_args=( -sS "${api_base}/audio/transcriptions" -H "Authorization: Bearer $OPENAI_API_KEY" -H "Accept: application/json" -F "file=@${in}" -F "model=${model}" -F "response_format=${request_format}" ) ``` The corresponding configurable-proxy behavior is documented in `SKILL.md` at lines 29 and 58. ### Technical Analysis The script obtains the transcription endpoint directly from the environment variable `OPENAI_BASE_URL`. It removes a trailing slash but performs no validation of the URL scheme, destination host, port, or embedded credentials. The resulting endpoint is passed to `curl` together with two sensitive assets: 1. `OPENAI_API_KEY`, transmitted in the `Authorization` header. 2. The complete user-selected audio file, transmitted as multipart form data. Consequently, any party capable of controlling the process environment or active OpenClaw configuration can redirect the request to an arbitrary server. The implementation also permits plaintext `http://` endpoints, ...[truncated 1897 chars]- Remediation
View remediation
