T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Bearer Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:43-47; vulnerable command examples appear atSKILL.md:53-56
Vulnerability Type: Bearer credential exposure through process arguments and command history
Risk Level: MediumVulnerable Code
markdown ## Protect credentials - Treat the `--key` value as sensitive - Do not print, commit, or hardcode the token - Keep the token in the command line argument, not in repo filesThe documented command pattern is:
sh cosin --key <token> <METHOD> <PATH> [--json '<json>'] [--header 'Name: value'] [--base-url <url>] cosin --key <token> agent [status|me] [--base-url <url>] cosin --key <token> skillsTechnical Analysis
The skill explicitly instructs users and agents to place a sensitive bearer token in a command-line argument. Depending on the operating environment, command-line arguments can be exposed through:
- Shell history files.
- Process inspection utilities and operating-system process interfaces.
- Terminal transcripts and agent tool-call records.
- CI/CD logs, debugging output, telemetry, or monitoring systems.
- Parent processes and other local processes operating with sufficient inspection privileges.
Avoiding repository files does not make command-line transmission safe. The token remains exposed to multiple local and operational logging surfaces.
Attack Path
- A user provides a valid COS bearer token to the agent.
- The agent follows the documented command shape and invokes
cosin --key <token> .... - The complete command, including the token, is retained in shell history, process metadata, terminal logs, or agent execution records.
- An attacker with access to one of those sources extracts the bearer token.
- The attacker uses the token to authenticate to COS and issue requests as the victim.
Impact Assessment
Token theft may permit unau ...[truncated 361 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not pass bearer tokens directly as command-line arguments.
- Add support for reading the token from a protected environment variable, standard input, operating-system credential store, or permission-restricted configuration file.
- Prefer an interactive hidden prompt when a human supplies the token.
- Ensure the CLI and surrounding agent infrastructure redact authorization credentials from logs, errors, telemetry, and command previews.
- Document shell-history protections for any unavoidable sensitive invocation.
- Use short-lived, narrowly scoped tokens and provide an immediate revocation and rotation procedure.
