T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:33
- Finding
- Private Key Exposure Through Command-Line Arguments## Vulnerability Details **File Location**: `SKILL.md`, lines 33–45 **Vulnerability Type**: Private key exposure through process arguments and command history **Risk Level**: High ### Vulnerable Code Snippet ```markdown ### createNewEthereumIdentity.js **Command**: `node scripts/createNewEthereumIdentity.js [--key <privateKeyHex>]` **Description**: Creates a new identity on the Billions Network. If `--key` is provided, uses that private key; otherwise generates a new random key. The created identity is automatically set as default. **Usage Examples**: ```bash # Generate a new random identity node scripts/createNewEthereumIdentity.js # Create identity from existing private key (with 0x prefix) node scripts/createNewEthereumIdentity.js --key 0x1234567890abcdef... # Create identity from existing private key (without 0x prefix) node scripts/createNewEthereumIdentity.js --key 1234567890abcdef... ``` ``` ### Technical Analysis The documented workflow passes a private identity key directly through the `--key` command-line argument. Command-line arguments are not an appropriate secret-delivery mechanism because they can be retained or exposed through: - Shell history files - Process inspection facilities - Terminal session recordings - Agent execution logs - Debugging and observability systems - Command auditing facilities Although the corresponding script is absent from the supplied project and its implementation cannot be reviewed, the documented interface itself explicitly requires the secret to be placed in the command line. The exposure occurs before the script can apply any internal protection. ### Attack Path 1. A user follows the documented example and imports an existing private key using `--key`. 2. The complete command, including the private key, is recorded in shell history, an execution log, or process metadata. 3. A local user, compromised process, support operator, or log reader ...[truncated 682 chars]
- Remediation
- ## Remediation Suggestions - Remove support for supplying private keys through command-line arguments. - Accept imported keys through protected standard input or an interactive no-echo prompt. - Prefer an operating-system keychain, hardware-backed keystore, or dedicated secret-management service. - Ensure secret values are never included in application, agent, terminal, telemetry, or error logs. - Clear transient secret buffers as soon as practical after importing the key. - Update all documentation and examples so they never display private keys in commands. - Add tests that reject `--key` and verify that secret values cannot appear in process arguments. - Advise users who have already followed the documented workflow to clear relevant histories and logs and rotate potentially exposed keys.
