T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:54
- Finding
- Live OKX credentials are passed through command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:54-56` **Vulnerability Type**: Credential exposure through process arguments and shell history **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 profile-creation command places the API key, secret key, and account passphrase directly in command-line arguments. Command arguments are not an appropriate channel for secrets because they may be exposed through: - Shell history files. - Process inspection utilities while the command is running. - Terminal session recording. - Operating-system audit and process telemetry. - CI/CD, orchestration, or support logs that record executed commands. - Agent tool-call logs and conversational transcripts. The credentials are explicitly associated with a live profile. Although this Skill documents read-only news operations, the same credentials may be accepted by other OKX interfaces. Their effective privileges depend on how the key was provisioned and cannot be constrained by this documentation alone. ### Attack Path 1. A user follows the documented recovery instructions after receiving a demo-mode error. 2. The user substitutes real values into the `AK`, `SK`, and `PP` command arguments. 3. The shell, terminal, operating system, Agent runtime, or automation environment records the complete command. 4. A local user, malware process, log operator, or other party with access to that telemetry retrieves the credentials. 5. The exposed credentials are used against the OKX account within the permissions granted to the API key. ### Impact ...[truncated 377 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove all examples that place secrets directly in command-line arguments. - Modify the CLI to collect credentials through protected interactive prompts with terminal echo disabled. - Alternatively, accept secrets through standard input or a secure operating-system credential store rather than process arguments. - Ensure `~/.okx/config.toml` is created with restrictive file permissions and never printed in logs. - Redact credential fields from Agent tool-call records, diagnostics, telemetry, and error messages. - Require narrowly scoped, read-only API credentials for this Skill. - Warn users to rotate credentials immediately if they have already entered them in shell commands. - Document how to clear relevant shell history and automation logs after accidental exposure. ]]>
