T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:112
- Finding
- Persistent Storage of CDP Credentials in a Plaintext Shell Startup File<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 112-125 **Vulnerability Type**: Plaintext storage of long-lived credentials **Risk Level**: High ### Vulnerable Code ```markdown ### Step 4 — Persist credentials (do this once after verifying) Once the balance check passes, ask the agent to save the credentials to `~/.zshrc` so they're available in every future session without prompting: > "验证成功了,帮我把这三个 CDP 变量写到 ~/.zshrc 里保存起来。" The agent will append: ```bash export CDP_API_KEY_ID="..." export CDP_API_KEY_SECRET="..." export CDP_WALLET_SECRET="..." ``` ``` ### Technical Analysis The Skill explicitly instructs the agent to persist the CDP API key secret and wallet secret in `~/.zshrc`. Shell startup files are plaintext files intended for shell configuration, not secret storage. They may be exposed through backups, support bundles, accidental repository commits, shell-configuration synchronization, permissive file permissions, or local processes running under the same account. Persisting these credentials also increases their lifetime and exposure beyond the immediate Xenodia operation. The CDP credentials permit access to Coinbase CDP services, while the wallet secret is associated with managed-wallet operations. This is broader and more sensitive than the minimum privilege required for a one-time balance check or authentication attempt. ### Attack Path 1. The owner follows the Skill instruction and writes the three CDP values to `~/.zshrc`. 2. A local process, compromised utility, backup service, synchronization tool, or user with sufficient filesystem access reads the startup file. 3. The attacker extracts `CDP_API_KEY_ID`, `CDP_API_KEY_SECRET`, and `CDP_WALLET_SECRET`. 4. The attacker initializes a CDP client using the stolen credentials. 5. Subject to the permissions assigned to the CDP API key and wallet, the attacker performs unauthorized API or wallet-signing operations. ### Impact Assessment Successful exploitation can di ...[truncated 404 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the instruction to append secrets to `~/.zshrc`. - Store credentials in an operating-system keychain, hardware-backed credential store, or dedicated secret manager. - Retrieve secrets only when required and keep them out of command histories, logs, prompts, and generated configuration files. - If file-based storage is unavoidable, use a dedicated file outside the project directory, create it atomically with mode `0600`, and verify ownership and permissions before loading it. - Use narrowly scoped CDP API credentials where supported. - Document credential rotation and revocation procedures. - Advise existing users to remove the values from shell startup files, inspect backups or synchronized dotfile repositories, and rotate all exposed credentials. ]]>
