T09 · Insecure Skill Coding Practices
- Location
scripts/deepgram-transcribe.sh:70- Finding
Deepgram API Token Exposed Through Process Arguments
- Content
View full analysis
"$json_out" ``` ```bash # scripts/deepgram-tts.sh:59-62 curl -sS --max-time 120 "https://api.deepgram.com/v1/speak?model=${model}" \ -H "Authorization: Token ${DEEPGRAM_API_KEY}" \ -H 'Content-Type: application/json' \ --data "$payload" > "$out" ``` ### Technical Analysis Both scripts interpolate `DEEPGRAM_API_KEY` directly into a `curl` command-line argument. The resulting authorization header can therefore be present in the process argument vector while the request is running. Depending on operating-system process visibility controls, command-line arguments may be accessible through process inspection interfaces such as `/proc//cmdline`, `ps`, monitoring software, diagnostic tooling, or process accounting. The exposure window is longer for large audio uploads or slow network requests. The token is not hardcoded in the project, but handling an environment-supplied secret this way unnecessarily transfers it into a more observable channel. ### Attack Path 1. An attacker obtains local process-inspection capability, such as access under the same service account or access permitted by the host's `/proc` configuration. 2. The victim starts either Deepgram script with a valid `DEEPGRAM_API_KEY`. 3. While `curl` is uploading audio or requesting generated speech, the attacker repeatedly enumerates running processes. 4. The attacker reads the `curl` argument vector and extracts the ...[truncated 812 chars]- Remediation
View remediation
"$config_file" curl --config "$config_file" \ -sS --max-time 120 \ "https://api.deepgram.com/v1/listen?model=${model}&smart_format=true&language=${language}&punctuate=true" \ -H "Content-Type: ${content_type}" \ --data-binary @"${in}" > "$json_out" ``` ]]>
