T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/cmd/config.go:23
- Finding
- Discogs Personal Access Token Exposed Through Command-Line Arguments## Vulnerability Details **File Location**: `SKILL.md:27-31`, `README.md:46-51`, `scripts/cmd/config.go:23-27`, and `scripts/cmd/config.go:46` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: Medium **Vulnerable code and documented usage:** ```go token, _ := cmd.Flags().GetString("token") username, _ := cmd.Flags().GetString("username") if token != "" { viper.Set("token", token) fmt.Println("Set 'token' in config.") } ``` ```go setCmd.Flags().StringP("token", "t", "", "Discogs Personal Access Token") setCmd.Flags().StringP("username", "u", "", "Discogs Username") ``` ```bash skills/discogs-cli/bin/discogs-cli config set -u "YourUsername" -t "YourSecretToken" ``` ### Technical Analysis The documented configuration procedure requires the personal access token to be supplied as the value of the `-t` command-line option. Command-line arguments are not an appropriate secret-input channel because they can be retained in shell history, Agent execution transcripts, command telemetry, audit logs, and diagnostic output. On some operating systems, other local users may also be able to inspect process arguments while the command is running. Although the token is legitimately required to authenticate to Discogs, exposing it through process arguments is not necessary for the Skill’s declared functionality. ### Attack Path 1. A user or Agent follows the documented setup command and places the Discogs token after `-t`. 2. The complete command is retained in shell history, an Agent tool-call record, process monitoring data, or another command log. 3. An attacker or unauthorized local user obtains access to that retained data. 4. The attacker extracts the token and submits authenticated requests to Discogs. 5. The attacker can exercise any Discogs account capabilities granted to that token, including reading private account data or modifying the wantlist where aut ...[truncated 402 chars]
- Remediation
- ## Remediation Suggestions - Remove the token command-line flag as the recommended secret-input mechanism. - Read the token from a masked interactive prompt using a terminal password-input API. - For noninteractive Agent operation, accept the token through standard input or a narrowly scoped environment variable, while ensuring it is not logged. - Prefer storing the token in an operating-system credential manager or secret service. - Remove literal token placeholders from executable command examples and clearly warn users not to place secrets in command history. - Review and redact existing Agent transcripts, shell histories, and automation logs that may contain tokens. - Advise affected users to revoke and rotate any token previously supplied through logged command lines.
