T09 · Insecure Skill Coding Practices
- Location
SKILL.md:53- Finding
User API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:53,SKILL.md:60, andSKILL.md:66
Vulnerability Type: Credential exposure through command-line arguments
Risk Level: MediumVulnerable Code
bash npm run cli -- auth login --token <your-token> --base-url https://www.sportfolio.marketbash npm run cli -- auth login --token <your-token> --base-url http://127.0.0.1:5000bash node packages/sportfolio-cli/bin/sportfolio.mjs auth login --token <your-token> --base-url https://www.sportfolio.marketTechnical Analysis
The documented authentication workflow instructs users to place a user API token directly in a command-line argument. Sensitive command-line arguments may be retained in shell history, terminal-session logs, command auditing systems, or diagnostic output. Depending on the operating system and process configuration, they may also be temporarily visible through process-inspection interfaces while the command is running.
This practice conflicts with the instruction at
SKILL.md:23to avoid placing tokens in shell history or logs. The placeholder itself is not a hardcoded secret, but users following the examples would replace it with a live bearer token.Attack Path
- A user creates a user-scoped Sportfolio API token.
- The user follows one of the documented commands and substitutes the live token for
<your-token>. - The shell records the command in history, or another local monitoring or diagnostic mechanism captures the process arguments.
- An attacker with access to the affected local account, history files, terminal logs, process telemetry, or command-auditing records extracts the token.
- The attacker submits the token to the documented Sportfolio MCP endpoint or uses it through the repository-local CLI.
- The attacker accesses capabilities available within the compromised user's account boundary, including immediate reads and any exposed account operations. Gameplay mutations remain subject ...[truncated 1001 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the
--tokenexamples with an interactive authentication command that reads the token from a hidden, non-echoing prompt. - Add support for reading the token from standard input or a protected credential store, ensuring that the value is never printed or logged.
- If environment-variable authentication is supported, document it only as a secondary option and warn that environment variables can also leak through child processes, diagnostics, crash reports, or misconfigured telemetry.
- Ensure the CLI redacts authorization headers and token values from normal output, errors, debug logs, exception traces, and telemetry.
- Store persistent credentials using operating-system credential facilities or a configuration file with restrictive permissions rather than plaintext command history.
- Document token revocation and rotation steps for users who previously entered tokens directly on the command line.
- Add automated documentation checks that reject examples containing sensitive options such as
--token <value>.
A safer interface would resemble:
bash npm run cli -- auth login --base-url https://www.sportfolio.market # The CLI then obtains the token through a hidden interactive prompt.- Replace the
