T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/password-manager.mjs:238
- Finding
- Secrets Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/password-manager.mjs:238-242`, `scripts/password-manager.mjs:623-631`; documented in `SKILL.md:36`, `SKILL.md:130`, and `SKILL.md:151` **Vulnerability Type**: Sensitive information exposure through process arguments **Risk Level**: High ### Vulnerable Code ```javascript const name = args.find((_, i) => args[i - 1] === '--name'); const type = args.find((_, i) => args[i - 1] === '--type') || 'password'; const username = args.find((_, i) => args[i - 1] === '--username'); const password = args.find((_, i) => args[i - 1] === '--password'); const tagsArg = args.find((_, i) => args[i - 1] === '--tags'); ``` The master-password change command also accepts both master passwords through arguments: ```javascript async function cmdChangePassword() { const rl = createReadline(); const oldPassword = args.find((_, i) => args[i - 1] === '--old'); const newPassword = args.find((_, i) => args[i - 1] === '--new'); if (!oldPassword || !newPassword) { console.log('❌ Missing --old or --new parameter'); console.log('Usage: password-manager change-password --old <old-password> --new <new-password>'); rl.close(); return; } ``` ### Technical Analysis The CLI accepts stored passwords, tokens, and old and new master passwords directly through command-line arguments. Process arguments are not a protected secret-input channel. Depending on the operating system and execution environment, they may be exposed through: - Process inspection utilities and process-monitoring APIs - Shell history - CI/CD job definitions and logs - Terminal session recording - Audit and observability systems - Parent-process telemetry - Error reports that capture complete command lines Exposure of the master password is especially severe because it permits decryption of the entire vault. Exposure of an entry password or token directly compromises that individual credential. ### Attack Path 1. A user follows the docume ...[truncated 1167 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove support for `--old` and `--new` master-password arguments. 2. Read both master passwords using hidden interactive input, with confirmation for the new password. 3. Replace entry `--password` input with hidden prompting or a protected file-descriptor mechanism. 4. For automation, support reading secrets from standard input only when explicitly requested, or from a caller-provided file descriptor with restrictive permissions. 5. Avoid environment variables as the preferred secret channel because they may also be exposed through process environments and orchestration metadata. 6. Remove all documentation examples that place secrets directly in command lines. 7. Display a deprecation warning before removing legacy secret-bearing arguments. 8. Ensure errors and debug telemetry never include raw argument arrays. ]]>
