T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:197
- Finding
- Wallet Passphrase and Seed Mnemonic Stored in Plaintext Files<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:197-198` **Vulnerability Type**: Plaintext storage of sensitive wallet credentials **Risk Level**: High ### Vulnerable Code ```markdown | **Wallet passphrase** | Stored at `~/.lnget/lnd/wallet-password.txt` (0600) | | **Seed mnemonic** | Stored at `~/.lnget/lnd/seed.txt` (0600) | ``` ### Technical Analysis The documented workflow stores both the wallet passphrase and seed mnemonic in plaintext files. File permissions of `0600` prevent access by other ordinary local accounts, but they do not encrypt the secrets or protect them from processes running as the wallet user, malware with user-level access, privileged users, insecure backups, filesystem snapshots, or accidental disclosure. A seed mnemonic is sufficient to reconstruct the associated wallet. Consequently, its confidentiality requirements are substantially higher than those of ordinary configuration data. Storing the passphrase beside the seed also weakens defense in depth if both files are captured together. The behavior exceeds the minimum privilege and exposure necessary for normal wallet operation because long-term plaintext retention of the recovery seed is not required after secure wallet initialization and backup. ### Attack Path 1. The user follows the Skill workflow and creates or initializes a funded Lightning wallet. 2. The supporting tooling writes the wallet passphrase and seed mnemonic to the documented paths. 3. An attacker compromises a process running under the same user, obtains an insecure backup or snapshot, or otherwise gains read access to the user's files. 4. The attacker reads `~/.lnget/lnd/seed.txt` and, if needed, `~/.lnget/lnd/wallet-password.txt`. 5. The attacker restores or unlocks the wallet using the captured credentials. 6. The attacker transfers available funds or otherwise compromises wallet assets. ### Impact Assessment Successful exploitation may disclose the wallet's root recovery secret and per ...[truncated 376 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not retain the seed mnemonic in a plaintext file after initialization. - Require the mnemonic to be recorded through a secure offline backup process, such as an encrypted removable backup or hardware-backed recovery mechanism. - Store operational credentials in an operating-system keychain, hardware security module, encrypted secret manager, or remote signer. - If a temporary seed file is unavoidable, create it with restrictive permissions, exclude it from backups and synchronization, securely delete it immediately after initialization, and clearly warn the user about residual filesystem recovery risks. - Keep wallet-unlock credentials separate from recovery material so that compromise of one storage location does not expose both. - Prefer the documented watch-only or remote-signer model for wallets holding significant funds. - Add explicit migration guidance requiring users who suspect disclosure to create a new seed and transfer all funds to addresses controlled by the new wallet. ]]>
