T09 · Insecure Skill Coding Practices
- Location
scripts/lib/config.sh:38- Finding
Unrestricted Colony credential path can cause arbitrary local file disclosure
- Content
View full analysis
/dev/null else cat "$cred_file" | tr -d '\n' fi } ``` From `scripts/adapters/colony.sh:52-54`: ```bash response=$(curl -s -w "\n%{http_code}" -X POST "$COLONY_API/auth/token" \ -H "Content-Type: application/json" \ -d "$(jq -n --arg key "$api_key" '{api_key: $key}')") ``` The default configuration at `bridge.json:19-22` is: ```json "colony": { "enabled": true, "credentials": "~/.config/colony/credentials.json", "auto_read": true } ``` ### Technical Analysis The Colony credential path is read directly from configuration and is only checked with `-f`. The implementation does not: - Restrict the path to a dedicated credential directory. - Require a specific filename or canonical path. - Reject symbolic links. - Verify file ownership or permissions. - Require a strict JSON credential schema. - Limit the amount of data read. For files not recognized as JSON by the first-line heuristic, the entire file is treated as a plaintext API key. It ...[truncated 1995 chars]- Remediation
View remediation
