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–24
Vulnerability Type: 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 instruction explicitly tells the user to replace the placeholder with a valid Grafana service-account token:
text Replace `<your-grafana-instance>` with your Azure Managed Grafana endpoint and `<your-token>` with a valid Grafana service-account token (starts with `glsa_`).Technical Analysis
The setup procedure embeds a live Grafana bearer token directly in a shell command argument. Secrets supplied through command-line arguments may be exposed through:
- Shell history files.
- Process listings or process-monitoring tools while the command is running.
- Terminal session logging.
- Command auditing and diagnostic telemetry.
- Copy-and-paste records or support transcripts.
The token is an authentication bearer credential: possession may be sufficient to access the configured Azure Managed Grafana MCP endpoint within the permissions granted to the associated service account. The instructions do not prescribe secure secret input, prevent shell-history retention, or require token rotation after accidental exposure.
Attack Path
- An operator follows the documented setup procedure and substitutes a valid
glsa_service-account token into the command. - The shell records the complete command in history, or a local process/audit collector observes its arguments.
- An attacker with access to that history, process metadata, terminal log, or diagnostic record extracts the bearer token.
- The attacker submits the token in an
Authorization: Bearerheader to the configured Grafana endpoint. - The attacker can invoke operations available to that service account until the token ...[truncated 470 chars]
- Remediation
View remediation
Remediation Suggestions
- Use OpenClaw's supported secret-management facility and reference the stored secret rather than placing its value in command-line arguments.
- If supported, accept the token through an interactive, non-echoing prompt or standard input.
- Avoid storing the raw token in workspace configuration, generated reports, shell scripts, or environment files committed to source control.
- Document a least-privilege Grafana service-account role restricted to the monitoring operations required by this Skill.
- Add instructions to rotate the token immediately if it has appeared in shell history, logs, screenshots, or diagnostic output.
- If a secure input method is temporarily unavailable, explicitly instruct users to disable history for the command and securely clear any existing history record; this should be treated only as a fallback rather than the primary mitigation.
- Ensure application logs and error messages redact the
Authorizationheader.
