T09 · Insecure Skill Coding Practices
- Location
src/cli.ts:27- Finding
Wallet Private Key Accepted Through Command-Line Arguments
- Content
View full analysis
", "Agent wallet private key") const privateKey = process.env.AGENT_PRIVATE_KEY || opts.key; ``` The implementation accepts the Agent wallet private key through the `--key` command-line option. Although the CLI warns users and gives precedence to `AGENT_PRIVATE_KEY`, the primary usage examples in both documentation files instruct users to pass the key through this option. ### Technical Analysis Command-line arguments are not an appropriate channel for private keys. Depending on the operating environment, arguments may be exposed through: - Shell history files. - Process inspection utilities and `/proc` metadata. - Terminal session recording. - CI/CD job logs. - Container orchestration metadata. - Monitoring and endpoint-management software. - Wrapper scripts that log invoked commands. The environment-variable alternative reduces shell-history exposure but can still be exposed through process environments, crash dumps, or improperly configured CI systems. A protected secret store, permission-restricted file descriptor, or interactive standard-input mechanism would provide stronger isolation. The affected private key belongs to a funded and contract-authorized Agent wallet. The documentation states that this should not be the NFA owner's main wallet, but the application cannot technically enforce that restriction. ### Attack Path 1. A user follows the documented startup example and supplies the private key with `--key`. 2. The command is retained in shell history, captured in an automation log, or exposed through local process inspection. 3. A local user, monitoring operator, compromised logging service, or other party with access to that data o ...[truncated 898 chars]- Remediation
View remediation
