T09 · Insecure Skill Coding Practices
- Location
SKILL.md:35- Finding
Generated Wallet Private Key Exposed in Plaintext Terminal Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 35–39 and 44–48
Vulnerability Type: Plaintext sensitive data exposure
Risk Level: HighVulnerable Code
js import { Wallet } from "ethers"; const wallet = Wallet.createRandom(); console.log("Address:", wallet.address); console.log("Private Key (save this securely!):", wallet.privateKey);js import { createWallet } from "viem/accounts"; const wallet = createWallet(); console.log("Address:", wallet.address); console.log("Private Key (save this securely!):", wallet.privateKey);Technical Analysis
Both recommended wallet-generation examples print the newly generated private key as plaintext. A private key is a complete bearer secret: possession of it is sufficient to impersonate the wallet owner and authorize blockchain transactions.
Terminal output may be retained in shell scrollback, CI/CD logs, command transcripts, screen recordings, remote-session logs, observability platforms, or AI-agent conversation history. The accompanying instruction to save the key securely does not prevent its initial disclosure through these channels.
Attack Path
- A user or automation agent follows one of the documented wallet-generation examples.
- The generated private key is printed to standard output.
- The terminal output is stored in a log, transcript, screen recording, or other monitoring system.
- An unauthorized user or compromised service obtains access to that output.
- The attacker imports the private key into a wallet or signing library.
- The attacker signs transactions as the victim and transfers wallet assets or performs other wallet-authorized operations.
Impact Assessment
Successful exploitation provides full control over the generated EVM wallet. The attacker can sign arbitrary transactions, transfer tokens, interact with contracts, and impersonate the wallet in signature-based authentication workfl ...[truncated 177 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not print private keys to standard output or expose them to an AI agent.
- Recommend creating wallets through a trusted wallet application or hardware wallet.
- If programmatic generation is required, store the key directly in an encrypted keystore protected by a strong password.
- Apply restrictive filesystem permissions before writing any sensitive material.
- Prevent wallet secrets from entering application, CI/CD, telemetry, or conversation logs.
- Display only the public wallet address after generation.
- Add an explicit warning that users must never paste private keys, seed phrases, or keystore passwords into support requests or agent conversations.
- Treat any key generated using the existing examples and captured in logs as compromised; move assets to a newly generated secure wallet and retire the exposed key.
