T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:45
- Finding
- Plaintext Wallet Keys and Seed Phrases Recommended in Workspace .env Files<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:45-58`, `SKILL.md:101-107`, `SKILL.md:222-245`, and `SKILL.md:262-267` **Vulnerability Type**: Plaintext sensitive credential storage and contradictory secret-handling guidance **Risk Level**: High ### Vulnerable Documentation `SKILL.md:45-58`: ```markdown ### 1. Private keys and seed phrases MUST NOT exist in workspace files **Files that are NOT safe:** - `SESSION-STATE.md` - `working-buffer.md` - `MEMORY.md` - `.env` (with the private key itself) - Any `.json`, `.txt`, `.md` in the workspace - Any AI conversation history (public platforms) **Safe alternatives:** - `.env` only, with keys referenced as env vars at runtime - Hardware wallets (keys never leave device) - Encrypted storage with passphrase - Wallets where private key is never stored at all (watch-only + hardware sign) ``` `SKILL.md:101-107`: ```markdown ``` Purpose | Wallet Type | Key Storage ---------------------|--------------------|---------------------- Trading/Active | Software (Solflare) | .env, never in files Grip/Bounty Earn | Software (MetaMask) | Seed phrase in .env only Long-Term Savings | Hardware (Ledger) | Never touches computer ``` ``` `SKILL.md:222-245`: ```markdown ### Wallet Strategy for This Agent ``` Wallet Type | Address | Storage | Used For ---------------|-------------------|---------------|-------------------------- Active DCA | [DISCARDED] | None | (empty, was drained) Bounty Earn | 0xD1089e... | .env only | Grip, ClawMoney Watch-Only | [YOUR WALLET] | TOOLS.md | Monitor only New DCA Wallet| TBD (new generation) | Hardware | Jupiter DCA (future) ``` ### Key Storage Rules 1. **Never write full private keys anywhere** (except .env, which must be gitignored) 2. **Never in conversation**: Even "let me check if this key is correct" 3. **Never in SESSION-STATE.md or working-buffer.md** 4. **Never in memor ...[truncated 3551 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove every recommendation to store private keys or seed phrases in `.env` files. 2. Explicitly prohibit storing recovery seed phrases in any digital workspace file, including `.env`, configuration files, source files, logs, and Agent memory. 3. Prefer hardware wallets or isolated signing services where private material never reaches the Agent or general-purpose workspace. 4. For automated wallets, use an operating-system keychain, hardware-backed keystore, cloud secret manager, or dedicated signer with narrowly scoped access controls. 5. If a low-value hot wallet must receive a secret through an environment variable, inject it directly at process startup from a secret manager rather than loading it from a workspace `.env` file. 6. Ensure secret-bearing processes use least privilege, disable debug logging and crash dumps where practical, and prevent child processes from unnecessarily inheriting sensitive environment variables. 7. Add defense-in-depth controls such as secret scanning, restrictive file permissions, excluded backup paths, deployment-context exclusions, and pre-commit checks. These controls must not be presented as substitutes for secure key custody. 8. Replace the vulnerable example with a signer interface that sends transaction data to a hardware-backed or isolated signing component and returns only the signature. 9. Instruct users who previously followed the `.env` guidance to treat stored keys as potentially exposed, create a new wallet using secure key generation, move remaining assets, revoke obsolete approvals, and permanently retire the old key or seed. ]]>
