Back to skill

Security audit

Azure Cloud Inspector Free

Security checks for vulnerabilities and agentic risk

Overview

This Azure inspection skill is not malicious, but it needs review because it can enumerate sensitive cloud metadata, write predictable local report files, and contains confusing write-operation language.

Install only if you are comfortable letting an agent run Azure CLI read commands against the selected subscription. Use a least-privilege Reader identity, confirm the exact subscription and resource-group scope first, and do not allow create, modify, delete, scale, or credential actions unless you explicitly requested them. Treat generated reports and snapshots as sensitive infrastructure data; prefer a private directory with restrictive permissions instead of /tmp and delete files when no longer needed.

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

Predictable Shared Temporary Files Permit Symlink Attacks and Audit-Data Tampering

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 176–194
Vulnerability Type: Unsafe temporary-file handling
Risk Level: Medium

bash
# 1. 生成当前配置快照
az resource list --query '[].{Name:name, Type:type, RG:resourceGroup, Tags:tags}' > /tmp/azure-snapshot-current.json

# 2. 与基线快照对比(假设基线快照已存在)
if [ -f /tmp/azure-snapshot-baseline.json ]; then
  echo "=== 与基线对比 ==="
  diff <(jq -r '.[] | "\(.Type)/\(.Name)"' /tmp/azure-snapshot-baseline.json | sort) \
       <(jq -r '.[] | "\(.Type)/\(.Name)"' /tmp/azure-snapshot-current.json | sort) || true
fi

# 3. 保存为新基线(用户确认后)
# cp /tmp/azure-snapshot-current.json /tmp/azure-snapshot-baseline.json
bash
REPORT="/tmp/azure-inspection-$(date +%Y%m%d-%H%M%S).md"

Technical Analysis

The Skill instructs the agent to store Azure inventory snapshots at fixed, globally predictable paths under /tmp. It also creates reports with timestamp-based names, which are predictable and may be exposed under an insufficiently restrictive process umask.

On a multi-user Unix-like system, another local user can pre-create /tmp/azure-snapshot-current.json as a symbolic link. Standard shell output redirection follows symbolic links, so executing the documented command may truncate and overwrite a target file writable by the account running the Skill.

The baseline path is also fixed and trusted based only on a file-existence check. An attacker able to write in the shared temporary directory can supply or replace the baseline with fabricated JSON, causing the drift comparison to produce false or misleading findings. No ownership, permission, regular-file, or symbolic-link validation is performed.

Attack Path

  1. An attacker with local access to the same host predicts the fixed snapshot or report path.
  2. For a file-overwrite attack, the attacker creates /tmp/azure-snapshot-current.json as a symbolic link to a file writable by the victim account.
  3. The victim invokes the Skill's configuration-drift workflo ...[truncated 1316 chars]
Remediation
View remediation

Remediation Suggestions

  • Create a private working directory rather than using fixed paths:
bash
umask 077
WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/azure-inspection.XXXXXXXX")" || exit 1
trap 'rm -rf -- "$WORK_DIR"' EXIT

CURRENT_SNAPSHOT="$WORK_DIR/azure-snapshot-current.json"
REPORT="$WORK_DIR/azure-inspection.md"
  • Keep snapshots and reports inside that private directory, which should have mode 0700.
  • Use mktemp for every generated file and avoid timestamp-only or otherwise predictable names.
  • Refuse symbolic links and validate that baseline files are regular files owned by the expected account before reading them.
  • Store persistent baselines in a user-owned configuration or state directory rather than shared /tmp, with directory mode 0700 and file mode 0600.
  • Write output to a newly created temporary file and atomically rename it into place after successful generation.
  • Apply umask 077 before creating files containing Azure inventory or subscription metadata.
  • Where supported, use APIs or file-opening mechanisms that enforce exclusive creation and do not follow symbolic links.
  • Protect persistent baselines with integrity controls, such as a securely stored checksum or signature, if they are used as authoritative audit evidence.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description and the full user-facing instructions are presented exclusively in Chinese, and the skill framing implies operation in that language by default. Under the language/locale policy, a skill should not effectively force a specific language unless it offers a choice, opt-in, or clearly documents a justified locale restriction.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The '已知限制' section says the free version only provides a current subscription role overview and does not produce audit reports or suggestions for RBAC. But the five-dimensional scoring model explicitly scores 'RBAC角色' and 'Owner数量', which is active RBAC risk assessment rather than mere overview, contradicting the edition-limit documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs automatic snapshot and report creation to local files but does not prominently warn users that environment inventory data will be written to disk. This is dangerous because cloud resource names, tags, topology, and drift data are sensitive operational metadata that may persist beyond the session and be accessible to other local actors.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill presents itself as read-only, but it automatically writes Azure inventory snapshots and generated reports to local files under /tmp. While this does not modify Azure resources, it does create persistent local artifacts containing potentially sensitive cloud inventory and configuration data without explicit consent or handling guidance. In a security-inspection context, such data can aid reconnaissance if accessible to other users, processes, or later exfiltration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The report-generation workflow stores Azure inventory and health details in a Markdown file without a privacy or data-handling warning. Even if credentials are excluded, the resulting report can reveal resource inventory, naming conventions, infrastructure health, and exposure posture, which materially assists attackers performing reconnaissance.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated capabilities section states support for create/modify/delete operations, contradicting the repeated read-only positioning elsewhere in the skill. In agent environments that rely on broad capability descriptions for tool selection or execution planning, this can expand the model's perceived authority and increase the chance of unintended destructive command generation or execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises broad applicability using generic everyday phrasing and scenario keywords without tight invocation constraints. In agent systems, overbroad trigger language can cause accidental activation in unrelated conversations, leading to unprompted cloud-environment enumeration, local file creation, or exposure of subscription metadata during otherwise normal dialogue.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest states that '成本管理' is a professional-only feature, yet the free template labels stopped VMs as '可能浪费成本'. While not a full cost-management module, this is still cost-oriented analysis that conflicts with the declared edition boundary.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.