T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:35
- Finding
- Private Key Exposure Through Command-Line Arguments## Vulnerability Details **File Location**: `SKILL.md`, lines 35-46 **Vulnerability Type**: Private key disclosure through process arguments and shell history **Risk Level**: High **Vulnerable Code Snippet**: ```markdown **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 interface accepts a private cryptographic key directly through the `--key` command-line argument. Command-line arguments are not an appropriate secret transport mechanism because they may be exposed through: - Shell history files. - Process inspection facilities while the command is running. - Process accounting and endpoint-monitoring systems. - Terminal session recordings. - Diagnostic logs and command telemetry. - Agent execution logs that record invoked commands. The examples actively encourage users or agents to place an existing identity key in this exposed channel. Although the artifact does not contain the referenced implementation scripts, the documented invocation itself creates a credible disclosure risk whenever followed. ### Attack Path 1. A user or agent follows the documented example and invokes `createNewEthereumIdentity.js` with a real private key in the `--key` argument. 2. The complete command is retained in shell history, agent logs, process telemetry, or another command ...[truncated 997 chars]
- Remediation
- ## Remediation Suggestions - Remove support and documentation for passing private keys through command-line arguments. - Accept imported keys through protected standard input without terminal echo, a dedicated secret manager, or a permission-restricted file descriptor. - If file-based import is unavoidable, require a file owned by the current user with restrictive permissions and securely remove temporary material after import. - Ensure invoked commands, arguments, and secret input are redacted from Agent logs, telemetry, error reports, and terminal recordings. - Add explicit documentation warning users never to place private keys in shell commands, environment variables, chat messages, or logs. - Prefer generating keys inside the encrypted keystore so raw private-key material does not need to cross an external interface. - Invalidate and rotate any key previously supplied through this interface if command history or logs may have retained it.
