T09 · Insecure Skill Coding Practices
- Location
scripts/clawlaunch.sh:64- Finding
API Credential Exfiltration Through Configurable API Endpoint
- Content
View full analysis
/dev/null || echo "") API_URL=$(jq -r '.apiUrl // "https://www.clawlaunch.fun/api/v1"' "$CONFIG_FILE" 2>/dev/null) else API_KEY="${CLAWLAUNCH_API_KEY:-}" API_URL="${CLAWLAUNCH_URL:-https://www.clawlaunch.fun/api/v1}" fi # API call helper api_call() { local method="$1" local endpoint="$2" local data="${3:-}" if [ "$method" = "GET" ]; then curl -s -X GET "${API_URL}${endpoint}" \ -H "x-api-key: $API_KEY" else curl -s -X POST "${API_URL}${endpoint}" \ -H "Content-Type: application/json" \ -H "x-api-key: $API_KEY" \ -d "$data" fi } ``` ### Technical Analysis The script loads `API_URL` from either the local configuration file or the `CLAWLAUNCH_URL` environment variable. It does not validate the URL scheme, hostname, port, or path before transmitting the API key in the `x-api-key` header. Consequently, the credential destination is not restricted to the declared ClawLaunch service. A modified configuration file can redirect all authenticated requests to an attacker-controlled endpoint. When no configuration file exists, an inherited or attacker-controlled environment can produce the same behavior. The network transmission itself is necessary for the declared functionality when the destination is the legitimate ClawLaunch HTTPS API. Allowing an unrestricted destination exceeds the minimum privilege required because the API credential should only be disclosed to the service that issued it. ### Attack Path 1. An attacker gains the ability to modify `~/.clawdbot/skills/clawlaunch/config.json`, such as through another compromised local process or insecure restoration of configuration files. 2. The at ...[truncated 1350 chars]- Remediation
View remediation
