T09 · Insecure Skill Coding Practices
- Location
manage.md:5- Finding
API Keys Exposed Through Command-Line Arguments and Plaintext Verification Output
- Content
View full analysis
- Remediation
View remediation
/dev/null 2>&1; then echo "Key exists" else echo "Key not found" fi ``` For Linux: ```bash if secret-tool lookup service keys:SERVICE >/dev/null 2>&1; then echo "Key exists" else echo "Key not found" fi ``` 3. **Keep Linux secret entry interactive.** Continue using `secret-tool store`, which prompts for the secret, and warn users not to pipe credentials from shell command lines or store them in environment variables. 4. **Add explicit Agent-safety guidance.** State that an Agent must never execute commands that return decrypted credentials and must not request that users place keys in command arguments, chat messages, or Agent-controlled terminals. 5. **Address existing exposure.** Users who followed the vulnerable instructions should remove affected commands from shell history and terminal logs, rotate the potentially exposed credentials, revoke old keys, and review provider audit logs for unauthorized use. 6. **Apply least privilege at the provider.** Restrict each API key to the minimum required scopes, projects, repositories, source addresses, spending limits, and expiration period so that accidental disclosure has reduced impact. ]]>
