T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:30
- Finding
- Wallet Private Key Disclosed Through Standard Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:30-34` **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: High ### Vulnerable Code ```javascript const { Wallet } = require('ethers'); const wallet = Wallet.createRandom(); console.log('Address:', wallet.address); console.log('Private Key:', wallet.privateKey); ``` ### Technical Analysis The documented wallet-generation procedure prints the newly generated private key directly to standard output. Private keys are bearer credentials: possession of the key is sufficient to authorize blockchain transactions from the wallet. Standard output is not an appropriate secret-handling channel. It may be retained in terminal scrollback, agent conversation transcripts, CI/CD logs, process supervisors, centralized logging platforms, debugging captures, or monitoring systems. Redaction is not guaranteed after the value has been emitted. Although the audited artifact contains documentation rather than the referenced implementation, an agent following these instructions would disclose the generated key as part of the documented workflow. ### Attack Path 1. A user or agent follows the wallet-generation example in `SKILL.md`. 2. `Wallet.createRandom()` creates a wallet with a new private key. 3. `console.log()` writes the complete private key to standard output. 4. The output is retained in a terminal log, agent transcript, CI log, monitoring platform, or other shared record. 5. An attacker or unauthorized operator obtains access to that record. 6. The attacker imports the private key into a wallet or signing tool. 7. The attacker signs transactions, transfers wallet assets, or exercises control over the Farcaster identity associated with the wallet. ### Impact Assessment Exposure grants full cryptographic control over the generated wallet. An attacker can transfer all assets held by the wallet, authorize transactions, impersonate the wallet owner, and potentially control the cor ...[truncated 138 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove all logging of private keys, seed phrases, signer keys, and related credentials. - Display only the public wallet address to the user. - Generate and store the private key directly in an operating-system keychain, hardware wallet, encrypted vault, or dedicated secret-management service. - Prevent secrets from entering agent transcripts or command results. - Add structured log redaction for private-key patterns as a defense-in-depth measure. - If a key has already been logged, treat it as compromised: migrate funds and account authority to a newly generated key and delete retained logs where possible. ]]>
