T09 · Insecure Skill Coding Practices
- Location
SKILL.md:73- Finding
Confirmation-Free Bulk Deletion of Azure Virtual Machines
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 73
Vulnerability Type: Unsafe destructive cloud operation
Risk Level: HighVulnerable code:
bash az vm list -g myRG -d --query "[].id" -o tsv | xargs az vm delete --ids --yesTechnical Analysis
The command enumerates every virtual machine in the specified resource group and pipes the resulting resource IDs directly into
az vm delete. The--yesoption suppresses Azure CLI's interactive confirmation.The operation has no preview stage, explicit subscription selection, resource allowlist, backup verification, resource-lock check, or separate user approval step. It also relies on the Azure CLI's currently active subscription, which may differ from the subscription intended by the user.
Because this Skill is designed to be followed by an AI Agent with command-execution access, an ambiguous request or stale Azure context could result in immediate deletion of unintended resources.
Attack Path
- An Agent is authenticated to Azure using an identity with permission to delete virtual machines.
- The active Azure CLI subscription points to a production or otherwise unintended subscription.
- A user requests a bulk cleanup operation, or an attacker supplies misleading resource-group information through untrusted task input.
- The Agent follows the documented pipeline and enumerates all virtual machines in the selected resource group.
xargspasses the resource IDs directly toaz vm delete.- The
--yesflag bypasses confirmation, causing the selected virtual machines to be deleted immediately.
Impact Assessment
Exploitation requires an Azure identity with virtual-machine deletion privileges. Within that identity's authorized scope, the operation can cause permanent workload removal, service outages, loss of ephemeral data, and recovery costs. If the identity has Contributor-level access at subscription scope, the potenti ...[truncated 65 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit tenant, subscription, resource-group, and resource-ID parameters for every destructive operation.
- List the exact resources selected for deletion and obtain explicit user confirmation before executing the delete command.
- Remove
--yesfrom general-purpose examples. Permit it only after a separately recorded approval step. - Validate that the active subscription matches an approved subscription allowlist.
- Check resource locks, backup status, recovery requirements, and environment tags before deletion.
- Replace the direct pipeline with a controlled script that handles empty input, validates every resource ID, and records an audit log.
- Use an Azure identity scoped only to the resource group required for the task.
