T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/transcribe.sh:63
- Finding
- Undisclosed Credential Fallback and Hardcoded API Destination Conflict with the Documented Security Contract## Vulnerability Details **File Location**: `SKILL.md:16-28, 37-44`; `scripts/transcribe.sh:63-73, 86-111` **Vulnerability Type**: Documentation and implementation mismatch causing unexpected credential and audio-data disclosure **Risk Level**: Medium The Skill documentation advertises an ARK-compatible transcription interface using `ARK_API_KEY`, a configurable `ARK_BASE_URL`, and `ARK_STT_MODEL`: ```markdown Default behavior: - Endpoint: `${ARK_BASE_URL:-https://ark.cn-beijing.volces.com/api/v3}/audio/transcriptions` - Model: `${ARK_STT_MODEL:-doubao-seed-asr-1-0}` - Auth header: `Authorization: Bearer $ARK_API_KEY` - Output file: `<input>.txt` ## Required env - `ARK_API_KEY` (required) Optional: - `ARK_BASE_URL` (default: `https://ark.cn-beijing.volces.com/api/v3`) - `ARK_STT_MODEL` (default: `doubao-seed-asr-1-0`) ``` The implementation instead retrieves Volcengine AUC credentials from environment variables or an OpenClaw configuration file: ```bash # Config fallback if [[ -z "$APP_ID" || -z "$ACCESS_TOKEN" ]]; then CFG="${OPENCLAW_CONFIG_PATH:-$HOME/.openclaw/openclaw.json}" if [[ -f "$CFG" ]] && command -v jq >/dev/null 2>&1; then [[ -z "$APP_ID" ]] && APP_ID="$(jq -r '.skills.entries["volcengine-stt"].appId // .skills.entries["volcengine-stt"].env.VOLC_APP_ID // .skills["volcengine-stt"].appId // .skills["volcengine-stt"].env.VOLC_APP_ID // empty' "$CFG")" [[ -z "$ACCESS_TOKEN" ]] && ACCESS_TOKEN="$(jq -r '.skills.entries["volcengine-stt"].accessToken // .skills.entries["volcengine-stt"].env.VOLC_ACCESS_TOKEN // .skills["volcengine-stt"].accessToken // .skills["volcengine-stt"].env.VOLC_ACCESS_TOKEN // empty' "$CFG")" CFG_RES="$(jq -r '.skills.entries["volcengine-stt"].resourceId // .skills.entries["volcengine-stt"].env.VOLC_RESOURCE_ID // .skills["volcengine-stt"].resourceId // .skills["volcengine-stt"].env.VOLC_RESOURCE_ID // empty' "$CFG")" ...[truncated 4350 chars]
- Remediation
- ## Remediation Suggestions 1. Make the implementation conform to the documented interface by implementing `ARK_API_KEY`, `ARK_BASE_URL`, `ARK_STT_MODEL`, and the documented `--prompt` option; alternatively, rewrite `SKILL.md` to accurately describe the AUC API, variables, headers, modes, and destinations. 2. Avoid silently reading credentials from `~/.openclaw/openclaw.json`. Require explicit opt-in through a flag or configuration setting before using the fallback. 3. Clearly disclose that the complete audio file and authentication headers are transmitted to `openspeech.bytedance.com`. 4. Provide a configurable endpoint with a secure default, validate it against an administrator-controlled HTTPS allowlist, and reject non-HTTPS URLs. 5. Fail closed when documented and actual configuration modes conflict. Do not silently substitute one API provider or authentication scheme for another. 6. Validate the selected mode, resource ID, polling interval, and timeout before making any request. 7. Use credentials with the minimum required API scope, rotate credentials that may have been used under incorrect assumptions, and apply provider-side quota and billing limits. 8. Add automated tests verifying that documentation examples map to supported options, expected credential sources, and the actual network destination. 9. Present an explicit confirmation or policy hook before uploading potentially sensitive recordings when the destination has not previously been approved.
