Back to skill

Security audit

AMG Cosmos DB for MongoDB (RU) Health Check

Security checks for vulnerabilities and agentic risk

Overview

This Cosmos DB health-check skill is mostly coherent, but it needs Review because setup exposes a Grafana bearer token through the shell and the workflow can persist detailed cloud inventory and telemetry locally.

Install only if you are comfortable granting the configured Grafana service account access to Azure monitoring data for the selected subscriptions. Use a narrowly scoped, revocable token, avoid pasting it directly into shell history if possible, and review or disable local memory/report writes if the workspace may be shared.

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:21
Finding

Grafana Service-Account Token Exposed Through Shell Command Arguments

Content
View full analysis
/api/azure-mcp","transport":"streamable-http","headers":{"Authorization":"Bearer "}}' ``` ``` ### Technical Analysis The setup instructions direct the user to replace `` with a valid Grafana service-account token and place that secret directly in a command-line argument. Secrets supplied this way may be exposed through: - Interactive shell history files. - Process inspection while the command is running. - Terminal session recording and command auditing. - Diagnostic bundles, support logs, or telemetry that capture command lines. - Accidental copying of the command into tickets, chat messages, or documentation. Although the file contains only a placeholder and does not ship a hardcoded credential, following the documented procedure with a real token creates a plaintext credential-handling weakness. ### Attack Path 1. A user follows the documented one-time setup procedure and replaces `` with a live Grafana service-account token. 2. The shell records the complete command in its history, or the command becomes visible through process or audit inspection. 3. An attacker with access to the same local account, readable history files, process metadata, terminal recordings, or collected diagnostic data extracts the bearer token. 4. The attacker submits the token to the configured Azure Managed Grafana endpoint. 5. The attacker obtains the permissions assigned to that service account and may access the AMG MCP interface and associated Azure monitoring data until the token expires or is revoked. ### Impact Assessment Successful exploitation grants the attacker the effective ...[truncated 558 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill description states that it 'tracks known issues across sessions via persistent report' and later performs config/report writes, but it does not clearly warn up front that invoking the skill will modify persistent workspace files. This can lead to unexpected state changes, retention of potentially sensitive operational data, and reduced user awareness/consent around cross-session storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs the agent to update memory/amg-check-cosmosdb-mongo-ru/report.md after presenting findings, including telemetry-derived bug status and a full resource inventory. Persisting this data without an explicit warning and opt-in can store sensitive infrastructure identifiers and historical operational findings across sessions, increasing privacy and data exposure risk if the workspace is shared or later accessed by other tasks.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guidance explicitly tells the agent to save oversized results to a temp file and parse them with locally installed interpreters or shells (node, python, jq, pwsh) and even to approve a Bash prompt. That expands the skill from Azure monitoring into arbitrary local code execution pathways, creating unnecessary risk of command injection, unsafe handling of untrusted data, and exposure of sensitive monitoring output on the host filesystem.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill recommends writing potentially sensitive cloud monitoring results to temporary files and processing them with local command-line interpreters, but provides no warning about local data exposure, file persistence, shell history, or host-side impact. In this skill context, the data may include account names, diagnostic output, and operational telemetry, so moving it outside the controlled tool flow increases confidentiality and integrity risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to write monitoring data to a temp file and parse it using external interpreters such as node, python, jq, or PowerShell. That expands the attack surface beyond the stated Azure monitoring workflow, creates opportunities for unsafe command construction or environment abuse, and can expose sensitive operational data to local disk or subprocess contexts without necessity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions explicitly recommend saving oversized metric responses to a temp file and processing them with external command interpreters, but provide no warning, consent, or controls around local persistence and subprocess execution. In this skill context, the data may include sensitive fleet-wide account telemetry, so silent disk writes and interpreter use increase confidentiality and operational risk beyond a normal health check.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.