Back to skill

Security audit

AMG Azure Subscription Cost Analysis

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Azure cost-analysis helper, but it needs review because it under-discloses sensitive token handling and includes an overbroad local parsing fallback.

Install only if you are comfortable giving this skill access to Azure/Grafana billing data. Use a least-privileged Grafana service account, avoid pasting live tokens into shell history or shared logs, rotate any token exposed during setup, and review or delete saved memory reports if they contain sensitive cost or subscription details.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
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: Medium

Vulnerable 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 with glsa_.

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

  1. The user replaces the token placeholder with a real Grafana service-account token.
  2. The user executes the documented openclaw mcp set command.
  3. The shell, operating system, terminal logger, or automation environment records or exposes the complete command.
  4. An attacker with access to the user's command history, process metadata, logs, or terminal records extracts the token.
  5. The attacker submits the stolen bearer token to the configured Grafana endpoint.
  6. 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

  1. Do not place the literal bearer token in command-line arguments.
  2. Prefer a secret-aware OpenClaw configuration mechanism or an interactive hidden prompt that reads the token without echoing it.
  3. If supported, read the token from standard input or a protected credential store rather than embedding it in the JSON argument.
  4. 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.
  5. Configure the resulting credential file with restrictive permissions accessible only to the intended user.
  6. Use a dedicated, least-privileged Grafana service account limited to the datasource and cost-analysis operations required by this Skill.
  7. Prefer short-lived credentials where supported and establish a regular token-rotation policy.
  8. Add explicit guidance for clearing affected shell history and immediately revoking and replacing any token entered using the current command.
  9. Ensure CI systems, terminal recorders, command-audit systems, and troubleshooting logs redact Authorization headers and tokens beginning with glsa_.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs users to configure an MCP server using a Grafana service-account bearer token directly in a command example, but does not include any warning about secret handling, storage, terminal history, or least-privilege scope. This can lead to accidental credential exposure in shell history, shared workspaces, screenshots, logs, or committed config files, especially because the token grants access to Azure/Grafana-backed cost data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The recovery step instructs the agent to save oversized results to a temp file and then execute whichever local interpreter is available via shell commands. That expands a read/query-only Azure cost analysis skill into arbitrary code execution, creating a path for command execution on local data using untrusted or oversized content and bypassing the skill's stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instruction to write result data to a temporary file and parse it with an installed interpreter introduces both execution risk and unsafe data-handling risk without guardrails. Even if intended for convenience, it normalizes shelling out on potentially attacker-influenced content and can expose sensitive billing data in temp files or lead to unsafe command construction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill persists subscription cost analysis output to a memory file without clearly disclosing that potentially sensitive billing metadata will be stored locally for future runs. While the data is not a secret in the same sense as credentials, billing patterns, subscription names, regions, and spending breakdowns can reveal internal infrastructure usage and business-sensitive information if retained or shared unintentionally.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.