T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/wallet.js:109
- Finding
- Wallet Mnemonic Exposed Through Agent-Visible Standard Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/wallet.js:109-130` **Vulnerability Type**: Plaintext disclosure of wallet recovery credentials **Risk Level**: High ### Vulnerable Code ```javascript console.log(` ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔐 NEW WALLET GENERATED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚠️ CRITICAL: Save this seed phrase securely! It will NOT be shown again. Anyone with this phrase can access your funds. Seed Phrase: ┌────────────────────────────────────────────────┐ │ ${mnemonic.split(' ').slice(0, 6).join(' ').padEnd(44)} │ │ ${mnemonic.split(' ').slice(6, 12).join(' ').padEnd(44)} │ └────────────────────────────────────────────────┘ Your Addresses: ├─ Solana: ${formatAddress(solanaAddr)} ├─ Base: ${formatAddress(evmAddr)} └─ Ethereum: ${formatAddress(evmAddr)} (same as Base) Full Addresses: ├─ Solana: ${solanaAddr} ├─ Base: ${evmAddr} └─ Ethereum: ${evmAddr} Add to .env: WALLET_SEED_PHRASE="${mnemonic}" ``` ### Technical Analysis The wallet creation command prints the complete BIP-39 mnemonic to standard output twice: once in the seed phrase box and again in the proposed `.env` assignment. In an AI Agent environment, process output is commonly captured in tool results, conversation history, execution traces, telemetry, terminal logs, or orchestration-system logs. Consequently, stdout is not an appropriate confidential channel for a wallet mnemonic. This behavior also conflicts with the security statement in `SKILL.md:150-152` that private keys are held in memory and the seed is never logged. Although displaying a newly generated mnemonic may be necessary during initial wallet creation, returning it through an Agent-visible execution channel is not the minimum-privilege method of delivering it. ### Attack Path 1. A user or Agent invokes `node scripts/wallet.js create`. 2. The command prints the complete mnemonic to stdout. 3. The Agent framework, terminal, CI syste ...[truncated 759 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not print the mnemonic to ordinary stdout or stderr in Agent-operated environments. - Deliver the mnemonic through an explicitly protected, out-of-band interface or a dedicated secret-management integration. - If local display is unavoidable, require an interactive terminal, refuse execution when stdout is redirected, and clearly warn that Agent transcripts may retain the value. - Store generated wallet material only after explicit user consent in a secret store with restrictive access controls. - Never include the mnemonic in proposed shell commands or `.env` assignment text. - Redact all mnemonic and private-key values from application logs, error handlers, telemetry, and tool responses. - Update `SKILL.md` so its security claims accurately describe the remaining exposure. ]]>
