T09 · Insecure Skill Coding Practices
- Location
bnb.js:125- Finding
Private Key Exposure Through Command-Line Arguments
- Content
View full analysis
--key '); await sendBNB(args[0], args[1], sendKey); break; case 'send-token': const tokenKey = getKey(args); if (!args[0] || !args[1] || !args[2] || !tokenKey) throw new Error('Usage: bnb.js send-token --key '); await sendToken(args[0], args[1], args[2], tokenKey); break; case 'address': if (!args[0]) throw new Error('Usage: bnb.js address '); getAddress(args[0]); break; ``` The documentation explicitly encourages users to provide private keys on the command line: ```bash node bnb.js send [--key ] ``` ```bash node bnb.js send-token [--key ] ``` ```bash node bnb.js address ``` ### Technical Analysis The Skill accepts wallet private keys through `process.argv`, either after `--key` or as the positional argument to the `address` command. Command-line arguments are not an appropriate secret-transport mechanism because they may be exposed through: - Shell command history. - Process inspection facilities while the command is running. - Process-monitoring and endpoint-management software. - Diagnostic reports, terminal recordings, audit logs ...[truncated 2082 chars]- Remediation
View remediation
