T09 · Insecure Skill Coding Practices
- Location
references/client-patterns.md:31- Finding
Bearer Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
references/client-patterns.md:31-35
Vulnerability Type: Bearer-token exposure through shell command arguments
Risk Level: Mediumbash openclaw mcp add basicops --transport streamable-http \ --url https://app.basicops.com/mcp \ --header "Authorization=Bearer <KEY>" openclaw mcp probe basicopsTechnical Analysis
The documented command instructs users to replace
<KEY>with a live BasicOps API key and pass it directly through the--headercommand-line argument. Secrets supplied this way may be exposed through shell history, terminal session logs, process inspection, command auditing, diagnostic output, or automation logs.This pattern conflicts with the project's own secret-handling guidance in
SKILL.md:44-47, which recommends environment variables, secret storage, or direct configuration placement and advises against echoing bearer tokens.Attack Path
- A user follows the documented quick recipe.
- The user substitutes a live BasicOps API key for
<KEY>. - The shell, operating system, terminal tooling, audit subsystem, or CI/CD runner records the command or its arguments.
- A local user, monitoring process, support operator, or log reader retrieves the exposed bearer token.
- The attacker submits the token to the BasicOps MCP endpoint.
- The attacker accesses BasicOps resources and operations permitted by that token.
This path requires access to relevant local process data, command history, or logs.
Impact Assessment
Successful exploitation discloses the BasicOps bearer token. The attacker can authenticate with the same BasicOps permissions and organizational scope granted to the compromised token. Potential consequences include unauthorized reads or modifications through the BasicOps MCP tool surface, depending on the token's privileges.
This issue does not itself provide operating-system privilege escalation or persistence. Its scope is bounded by the compromise ...[truncated 35 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the command-line token example with the client's supported secret store, protected credential helper, or interactive secret-input mechanism.
- If supported, reference a protected environment variable without expanding it into process arguments.
- Store credentials in a configuration file only when it has restrictive permissions and the client does not expose the value in logs or status output.
- Explicitly warn users not to paste live API keys into commands retained by shell history.
- Redact authorization headers from command output, diagnostics, audit records, and CI/CD logs.
- Apply least privilege and short expiration periods to BasicOps API keys where supported.
- Document immediate token rotation if a key was entered into an exposed command, terminal recording, or shared automation log.
