T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:54
- Finding
- Live API credentials exposed through command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 54–56 **Vulnerability Type**: Sensitive credentials passed through command-line arguments **Risk Level**: High ### Vulnerable Code ```markdown **On "not available in demo" errors:** the user's current profile is configured with demo/simulated credentials. Tell the user: "News module does not support demo mode. Please switch to a live profile." Guide them to either: - Use `--profile live` if a live profile exists: `okx --profile live news latest` - Or create one: `okx config add-profile AK=<key> SK=<secret> PP=<passphrase> name=live` ``` ### Technical Analysis The documented profile-creation command places the OKX API key, secret key, and passphrase directly in command-line arguments. Sensitive values supplied this way may be exposed through: - Shell history files. - Process inspection utilities while the command is running. - Terminal logging or session recording. - Command auditing and endpoint-monitoring products. - Accidental copying of complete commands into support tickets or logs. These are credentials for a live financial-service profile rather than simulated credentials. The effective impact depends on the permissions assigned to the API key, but the Skill does not require or verify that the key is restricted to read-only access. ### Attack Path 1. A user follows the setup instructions after encountering a demo-profile error. 2. The user substitutes real values for `AK`, `SK`, and `PP` in the command. 3. The shell records the command in its history, or a local process observes its arguments. 4. Another local user, malicious process, support operator, or monitoring system obtains the exposed values. 5. The attacker authenticates to the OKX API using the stolen credentials. 6. The attacker gains the permissions assigned to that API key, potentially exceeding the read-only access needed by this Skill. ### Impact Assessment An attacker may obtain authenticated access to the vic ...[truncated 453 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove examples that place secrets directly in command-line arguments. 2. Modify the CLI to collect secrets through interactive prompts with terminal echo disabled. 3. Where interactive input is unavailable, accept secrets through protected standard input or an operating-system credential manager. 4. Avoid environment variables for long-lived secrets where they may be inherited or exposed through diagnostics. 5. Ensure `~/.okx/config.toml` is created with restrictive permissions, such as owner read/write only. 6. Explicitly instruct users to create a dedicated read-only API key with only the permissions required for news and sentiment queries. 7. Validate the selected profile's permissions before use and reject credentials with trading or withdrawal permissions when those permissions are unnecessary. 8. Advise users who have already used the documented command to clear relevant shell history securely and rotate the exposed credentials. ]]>
