Back to skill

Security audit

AMG Key Vault Health Check

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Azure Key Vault health-check tool, but it asks users to configure a bearer token in a shell command and persists sensitive operational findings with limited safeguards.

Install only if you are comfortable granting the skill access to Azure Managed Grafana telemetry for the configured subscriptions. Use a least-privilege, short-lived Grafana service-account token, avoid pasting it directly into shell history, and review or redact memory/amg-check-key-vault reports because they may contain subscription IDs, vault names, caller IPs, app IDs, and secret/key object references.

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 Service-Account Token Exposed Through Command-Line Configuration

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 20–25
Vulnerability Type: Plaintext sensitive data in command-line arguments and configuration
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>"}}'
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 instructions require the user to substitute a live Grafana service-account token directly into a shell command. This exposes the bearer token in the command-line argument and may also cause it to be stored in plaintext by the MCP configuration mechanism.

Depending on the operating environment, the token may be recoverable from:

  • Shell history files
  • Process listings or endpoint-monitoring telemetry while the command executes
  • Terminal session logs
  • Shell-history synchronization services
  • Diagnostic or support bundles
  • The resulting OpenClaw MCP configuration file

A bearer token grants access based on possession. An attacker who obtains it does not need the original user's password or an additional cryptographic secret. The precise capabilities available to the attacker depend on the permissions assigned to the Grafana service account.

Attack Path

  1. A user follows the documented setup process and replaces <your-token> with a valid Grafana service-account token.
  2. The shell records the complete command in its history, or a local monitoring process captures the command-line arguments.
  3. The MCP registration mechanism may additionally persist the authorization header in a local configuration file.
  4. A local attacker, compromised process, history synchronization service, or diagnostic-data recipient retrieves the token.
  5. The attacker sends requests to the configured Azu ...[truncated 1020 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not place bearer tokens directly in shell command arguments.
  2. Obtain the token through a hidden interactive prompt, standard input, an operating-system credential store, or a supported secret-reference mechanism.
  3. If environment-variable substitution is unavoidable, ensure the tooling stores a secret reference rather than expanding and persisting the plaintext value.
  4. Store MCP credentials in a dedicated secrets backend or an encrypted credential file with permissions restricted to the owning user.
  5. Clearly document the location and protection requirements of any generated configuration file.
  6. Configure short token lifetimes and the minimum Grafana roles and datasource permissions necessary for the health check.
  7. Rotate any token that has already been entered literally into a shell command.
  8. Remove affected commands from shell history and review terminal logs, diagnostic bundles, and synchronized history for copies.
  9. Avoid printing authorization headers in verification output, debug logs, or error messages.

A safer conceptual setup flow is:

bash
read -s -p "Grafana service-account token: " GRAFANA_TOKEN
echo
# Pass the token through a protected secret-input facility supported by OpenClaw.
unset GRAFANA_TOKEN

The implementation must ensure that the token is neither included in process arguments nor written as plaintext into ordinary configuration.

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 (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly states it 'Tracks known issues across sessions via persistent report' and later instructs the agent to update memory/amg-check-key-vault/report.md, but the description does not clearly warn the user up front that running the skill will write persistent data. This creates a privacy and transparency issue: operational findings, subscription details, and incident history may be retained across sessions without sufficiently explicit consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The markdown presents queries that reveal caller IPs, app IDs, and object identifiers without any warning, consent step, or handling guidance for sensitive output. Because the skill is intended for broad fleet-wide use and tracks issues across sessions, omission of such safeguards increases the risk that users will expose or retain sensitive telemetry unintentionally.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

These deep-dive queries retrieve CallerIPAddress, application IDs, and object/resource identifiers, which expands the skill from service health monitoring into actor and object-level activity inspection. In a fleet-wide skill with persistent reporting, this creates unnecessary exposure of sensitive operational metadata that could aid lateral investigation, profiling, or targeting if viewed by an unauthorized or over-broad audience.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The traffic analysis section enumerates top caller IPs and application identities even though the skill is described as a Key Vault health check rather than an access-investigation or forensics tool. This broadens visibility into client attribution data beyond the declared purpose and can expose sensitive tenant activity patterns across all vaults.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The secret/key analysis queries inspect specific object references via id_s and identify the most accessed or failed secret/key operations, which goes beyond platform health into inventory and usage intelligence. Even without secret values, object identifiers and access patterns are sensitive and can reveal high-value assets, naming conventions, and operational dependencies.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The guidance tells the agent to save data to a temporary file and then invoke a local interpreter or shell-capable tool (node, python, jq, pwsh) to parse it. That expands the skill from Azure health-checking into arbitrary local code execution territory, which is unnecessary for the stated purpose and creates a path for command execution, unsafe file handling, and processing of untrusted content in the host environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instruction explicitly directs saving results to a temp file and running an interpreter, while even encouraging approval of a Bash prompt on first use, without a clear user-facing warning about filesystem writes or execution side effects. In an agent skill, this is dangerous because tool output and filenames may be influenced by untrusted data, and the user may not expect the skill to transition from cloud querying into local file creation and command execution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.