T09 · Insecure Skill Coding Practices
- Location
scripts/speech_to_text.sh:145- Finding
Zhipu API Key Exposed Through Command-Line Arguments
- Content
View full analysis
/cmdline`, `ps`, or auditing and monitoring software. Exploitation requires local process-inspection access, generally from the same account or a sufficiently privileged account, depending on operating-system process-isolation settings. ### Attack Path 1. A victim runs `scripts/speech_to_text.sh` with a valid `ZHIPU_API_KEY`. 2. The script launches `curl` and embeds the bearer token in its argument vector. 3. A local attacker or monitoring process observes newly launched `curl` processes. 4. The attacker reads the process arguments while the request is active and extracts the Authorization header. 5. The attacker reuses the recovered token when sending requests to Zhipu AI. The observation window may be ...[truncated 577 chars]- Remediation
View remediation
"$CURL_CONFIG" RESPONSE=$(curl --silent --show-error \ --config "$CURL_CONFIG" \ --request POST \ "$API_ENDPOINT" \ --form "file=@$AUDIO_FILE" \ --form "model=glm-asr-2512") ``` The implementation should also preserve the existing prompt and hotword form fields without placing the API key back into the argument vector. ]]>
