T09 · Insecure Skill Coding Practices
Note
- Location
- SKILL.md:591
- Finding
- API Credentials Exposed Through Shell Scripts, Command Arguments, and Command History## Vulnerability Details **File Location**: `SKILL.md:591-604`, `SKILL.md:617-617`, `SKILL.md:666-670`, `SKILL.md:679-683`, and `README.md:30-37` **Vulnerability Type**: Insecure credential handling **Risk Level**: Low ### Vulnerable Code `SKILL.md:591-604`: ```bash API_KEY="YOUR_API_KEY" DATE="2024-01-15" # 1. Get completed activities ACTIVITIES=$(curl -s -H "Authorization: ApiKey $ATHLETE_ID:$API_KEY" \ "https://intervals.icu/api/v1/athlete/$ATHLETE_ID/activities?oldest=$DATE&newest=$DATE&fields=id,name,type,distance,icu_training_load") # 2. Get planned workouts for today EVENTS=$(curl -s -H "Authorization: ApiKey $ATHLETE_ID:$API_KEY" \ "https://intervals.icu/api/v1/athlete/$ATHLETE_ID/events?oldest=$DATE&newest=$DATE&category=WORKOUT") # 3. Get wellness data WELLNESS=$(curl -s -H "Authorization: ApiKey $ATHLETE_ID:$API_KEY" \ "https://intervals.icu/api/v1/athlete/$ATHLETE_ID/wellness/$DATE") ``` `README.md:30-37`: ```bash curl -H "Authorization: ApiKey YOUR_ATHLETE_ID:YOUR_API_KEY" \ https://intervals.icu/api/v1/athlete/YOUR_ATHLETE_ID **Bearer Token (OAuth):** ```bash curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ https://intervals.icu/api/v1/athlete/YOUR_ATHLETE_ID ``` ### Technical Analysis The documentation instructs users to place an Intervals.icu API key or OAuth bearer token directly in shell commands or assign it as plaintext in a shell script. When the command is executed, the expanded `Authorization` header may be exposed in the `curl` process arguments to local process-inspection facilities. If users directly substitute credentials into an interactive command, those credentials can also remain in shell history. Saving the workflow with a real key embeds the credential in a plaintext file. The examples use placeholders rather than actual committed credentials, so the project itself does not disclose a live secret. The vulnerability arises when use ...[truncated 1497 chars]
- Remediation
- ## Remediation Suggestions 1. Do not instruct users to paste production secrets directly into interactive commands or source-controlled scripts. 2. Retrieve credentials at runtime from a dedicated secret manager, operating-system keychain, or permission-restricted configuration file. 3. If environment variables are demonstrated, explain that they can still leak through process environments, diagnostics, child processes, or accidental logging and must not be stored in committed files. 4. Prefer a permission-restricted `curl` configuration file or an equivalent mechanism that prevents the authorization value from appearing directly in command arguments. Ensure the file is readable only by its owner and excluded from version control. 5. Add explicit warnings against committing credentials, sharing terminal transcripts, enabling shell tracing with secrets, or leaving real keys in shell history. 6. Recommend short-lived OAuth tokens and least-privilege scopes where supported. 7. Document immediate credential revocation and rotation procedures for suspected exposure. 8. Add secret-scanning rules and pre-commit checks to detect accidentally committed API keys or bearer tokens.
