Back to skill

Security audit

azure-cli

Security checks for vulnerabilities and agentic risk

Overview

This Azure CLI skill appears purpose-related but needs review because it tells users to run an unverified remote installer and includes cloud-changing commands with loose scope.

Review before installing. Prefer official package-repository installation steps over the curl-to-bash command, confirm the active Azure subscription before running any examples, and require explicit approval for commands that create or modify cloud resources because they can affect accounts and billing.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:88
Finding

Unverified Remote Installation Script Executed Directly by Shell

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 88
Vulnerability Type: Remote payload retrieval and execution
Risk Level: High

Vulnerable Code

bash
curl -sL https://aka.ms/InstallAzureCliLinux | bash

Technical Analysis

The Linux installation instructions download a remote script from an aka.ms redirect and pipe its contents directly into bash. Although aka.ms is associated with Microsoft and installing Azure CLI is relevant to the Skill's declared functionality, the command does not pin the retrieved artifact, disclose the final redirect destination, or verify a cryptographic checksum or signature before execution.

The effective payload can therefore change after the Skill has been reviewed. The use of -sL also silently follows redirects, reducing visibility into the source and download process. If the redirect, final hosting location, delivery infrastructure, or remote script were compromised, an attacker could supply arbitrary shell commands. Those commands would execute immediately with the privileges of the user running the installation command.

Direct execution of unverified remote content is not the minimum privilege or minimum-risk mechanism necessary to install Azure CLI. A signed operating-system package repository or a separately downloaded and verified installer would provide the required functionality with a narrower trust boundary.

Attack Path

  1. A user or AI Agent follows the Linux installation instructions in SKILL.md.
  2. curl connects to the shortened URL and silently follows its redirect.
  3. The remote endpoint returns the current installer script. Its content is not pinned or locally inspected.
  4. The script is streamed directly to bash without checksum or signature verification.
  5. If the remote delivery path has been compromised, attacker-controlled shell commands execute immediately.
  6. Those commands can perform any action allowed to the invoking account and may obtain greater s ...[truncated 927 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the curl | bash pipeline with Microsoft's documented signed package-repository installation procedure for the target Linux distribution.
  2. Pin the Azure CLI package to an approved version where operationally feasible.
  3. Verify repository signing keys through an independently documented fingerprint and require package-signature validation.
  4. If a script-based installer is unavoidable:
    • Use a documented final HTTPS URL instead of an opaque shortened redirect.
    • Download the script to a local file without executing it.
    • Verify a vendor-published cryptographic checksum or digital signature.
    • Inspect the downloaded script before execution.
    • Execute it as an unprivileged user unless a specific installation step demonstrably requires elevation.
    • Apply elevated privileges only to the narrowly scoped commands that require them.
  5. Avoid silent download flags in security-sensitive installation documentation so users can observe failures and redirects.
  6. Document the expected source, version, hash, required privileges, and files or system settings modified by the installation process.

A safer conceptual workflow is:

bash
curl --fail --show-error --location \
  --output azure-cli-installer.sh \
  "https://documented.vendor.example/pinned/installer.sh"

echo "EXPECTED_SHA256  azure-cli-installer.sh" | sha256sum --check
less azure-cli-installer.sh
bash azure-cli-installer.sh

The placeholder URL and checksum must be replaced with independently verified, vendor-published values. A signed distribution package remains preferable.

Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The command 'curl -sL https://aka.ms/InstallAzureCliLinux | bash' is a textbook arbitrary remote-script execution pattern. Its danger is amplified here because the skill includes an exec tool, so an agent or user could treat the documentation as runnable guidance and execute code from a remote URL without inspection.

Content

Scanner excerpt · SKILL.md (reported line 88)May include surrounding context.

Linux (Ubuntu/Debian):

bash
curl -sL https://aka.ms/InstallAzureCliLinux | bash

Windows:

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The shell pipeline chains network retrieval directly into execution, removing any inspection boundary and creating a compact abuse pattern for arbitrary command delivery. Even if the current URL is legitimate, the pattern is unsafe because compromise of the source, redirects, or surrounding environment would immediately translate into code execution.

Content

Scanner excerpt · SKILL.md (reported line 88)May include surrounding context.

Linux (Ubuntu/Debian):

bash
curl -sL https://aka.ms/InstallAzureCliLinux | bash

Windows:

Chaining Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The repeated '| bash' example reinforces the same unsafe pattern in a later sample block, increasing the chance that users or agents will copy it blindly. Duplicating the pattern in instructional examples normalizes risky behavior and broadens exposure to arbitrary code execution from remote content.

Content

Scanner excerpt · SKILL.md (reported line 206)May include surrounding context.

请参考上方使用说明进行配置和调用

result = "ready"

bash
ms/InstallAzureCliLinux | bash

请参考上方使用说明进行配置和调用

result = "ready"

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description mixes Azure CLI management with broad, unrelated scenarios like code review, project management, workflow automation, and intelligent decision support, without clearly stating what specific user requests should trigger this skill. This ambiguity increases the chance of unintended invocation because the activation context is not narrowly scoped to Azure CLI tasks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The phrase describing the skill as providing workflow automation and intelligent decision-support capabilities is highly generic and overlaps with many common requests outside Azure CLI usage. In a markdown skill description, such broad wording can cause accidental matches with ordinary user intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest summary and description present this as an Azure cloud management command-line skill, but the feature matrix advertises code static analysis, vulnerability detection, batch code review, and report generation. Those are separate developer-security capabilities not inherently part of Azure CLI management, so the documented behavior exceeds and diverges from the stated scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Piping a remotely fetched script directly into bash executes unreviewed code from the network without giving the user a chance to inspect it. In a skill that advertises exec capability, this is especially dangerous because it normalizes a high-risk installation pattern that could result in arbitrary code execution if the remote endpoint, redirect, or transport chain is compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The documentation includes live Azure commands that can authenticate, select subscriptions, and create resource groups without an adjacent, explicit warning that these actions are state-changing and may incur cost. In an agent skill context with exec capability, such examples can be copied or auto-followed by users or tools, leading to unintended resource creation, charges, or modification of the wrong subscription.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill for comprehensive Azure cloud management via command-line interface, but the documented input/output schema is for '审查严格度', scoring, code style, security compliance, and improvement suggestions. That behavior describes a code review or analysis tool rather than an Azure CLI management skill, indicating a semantic mismatch between the claimed purpose and the documented behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

Line L046 describes the skill's core function as generic workflow and intelligent decision assistance, which conflicts with the rest of the file that focuses on Azure CLI installation, login, account selection, and resource-group management. This is more than incomplete wording; it describes a different intent than the operational content below.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.