T09 · Insecure Skill Coding Practices
- Location
SKILL.md:62- Finding
Plaintext Private Keys May Be Exposed Through Command-Line Wallet Import
- Content
View full analysis
``` ```text Accepts: - PEM-formatted private key: `-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----` - JSON keystore: `{"algorithm":"aes-256-gcm",...}` ``` ### Technical Analysis The documented wallet-import interface permits a PEM-formatted private key to be supplied directly as a command-line argument. Secrets passed this way may be exposed through: - Shell history files - Process listings and process-monitoring tools - Terminal session recording - CI/CD job logs - Command auditing and telemetry - Wrapper scripts that log their arguments The risk applies even if the imported key is subsequently encrypted because the key has already appeared in plaintext at the process invocation boundary. This behavior also conflicts with the statement at `SKILL.md:190` that the private key is “never exported in plaintext.” ### Attack Path 1. A user follows the documented syntax and passes a PEM private key directly to `devtopia id wallet import`. 2. The shell stores the command in history, or a local monitoring/logging system records the process arguments. 3. An attacker with access to the history, logs, process metadata, or recorded terminal session retrieves the plaintext key. 4. The attacker imports the key into another wallet or compatible signing tool. 5. The attacker signs proofs or transactions while impersonating the legitimate agent. ### Impact Assessment Disclosure of the private key grants the attacker the cryptographic authority associated with the wallet. Depending on how the identity is used, this may allow: - Agent identity impersonation - Forging challenge-response proofs - Unauthorized blockchain transaction signing - Unauthorized marketplace actions - Permanent compromise of the wallet-b ...[truncated 152 chars]- Remediation
View remediation
