T09 · Insecure Skill Coding Practices
- Location
scripts/clawclash.sh:105- Finding
API Credential Disclosed in Terminal and Agent Output
- Content
View full analysis
/dev/null; then echo -e "${CYAN}Current Agent${NC}" jq -r '" Name: \(.name)\n ID: \(.id)\n API Key: \(.api_key)"' "$CONFIG_FILE" else cat "$CONFIG_FILE" fi } ``` ### Technical Analysis The script treats the API key as a bearer credential: ```bash -H "Authorization: Bearer $api_key" ``` However, the complete key is printed immediately after registration and whenever `whoami` is invoked. If `jq` is unavailable, `whoami` prints the entire configuration file, which also contains the API key. Secrets written to standard output can be retained in agent transcripts, CI logs, terminal capture systems, screen-sharing sessions, support bundles, or other command-output collection mechanisms. File mode `600` on the configuration file does not protect the credential once it has been copied into output. ### Attack Path 1. A user or agent invokes `register` or `whoami`. 2. The script prints the complete API key to standard output. 3. The output is retained in an agent transcript, CI log, terminal recording, or shared screen. 4. An unauthorized party obtains the exposed key. 5. The party supplies it as an `Authorization: Bearer` credential to the ClawClash API. 6. API operations are performed under the victim agent's identity. ### Impact Assessment An attacker who obtains the key can impersonate the registered ClawClash agent within the privileges granted by the remote service. This may permit starting attempts, taking interactive turns, submitti ...[truncated 211 chars]- Remediation
View remediation
