T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Grafana Bearer Token Exposed in Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 20–22
Vulnerability Type: Plaintext credential exposure through command-line arguments
Risk Level: MediumVulnerable Code
bash openclaw mcp set amg '{"url":"https://<your-grafana-instance>/api/azure-mcp","transport":"streamable-http","headers":{"Authorization":"Bearer <your-token>"}}'The accompanying instructions direct the user to replace
<your-token>with a valid Grafana service-account token beginning withglsa_.Technical Analysis
The setup procedure places a live bearer token directly in a command-line argument. Depending on the operating system, shell configuration, and execution environment, the complete command may be:
- Persisted in the user's shell history.
- Temporarily exposed through process-argument inspection facilities.
- Captured by terminal logging, command auditing, diagnostic tooling, or automation logs.
- Copied into support records or documentation during troubleshooting.
Quoting the JSON argument prevents ordinary shell expansion but does not protect the token from history retention or process-argument visibility. Because a bearer token authorizes its holder without requiring additional proof of identity, disclosure can enable immediate credential reuse.
Attack Path
- The user replaces the token placeholder with a real Grafana service-account token.
- The user executes the documented
openclaw mcp setcommand. - The shell, operating system, terminal logger, or automation environment records or exposes the complete command.
- An attacker with access to the user's command history, process metadata, logs, or terminal records extracts the token.
- The attacker submits the stolen bearer token to the configured Grafana endpoint.
- The attacker performs operations permitted by the compromised Grafana service account until the token is revoked or expires.
This path requires a ...[truncated 819 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place the literal bearer token in command-line arguments.
- Prefer a secret-aware OpenClaw configuration mechanism or an interactive hidden prompt that reads the token without echoing it.
- If supported, read the token from standard input or a protected credential store rather than embedding it in the JSON argument.
- If environment-variable expansion is unavoidable, ensure the secret is not printed, logged, or persisted, and unset the variable immediately after configuration. Document that environment variables may still be observable in some environments.
- Configure the resulting credential file with restrictive permissions accessible only to the intended user.
- Use a dedicated, least-privileged Grafana service account limited to the datasource and cost-analysis operations required by this Skill.
- Prefer short-lived credentials where supported and establish a regular token-rotation policy.
- Add explicit guidance for clearing affected shell history and immediately revoking and replacing any token entered using the current command.
- Ensure CI systems, terminal recorders, command-audit systems, and troubleshooting logs redact
Authorizationheaders and tokens beginning withglsa_.
