By NHI Mgmt Group Editorial TeamPublished 2026-06-04Domain: Workload IdentitySource: Unosecur

TL;DR: Azure Managed Identity abuse through IMDS lets an attacker with code execution on a single VM obtain a trusted OAuth token and move laterally with the machine’s full cloud permissions, according to Unosecur. The core failure is not a CVE but an over-privileged trust model that IAM and cloud teams must treat as an identity risk.


At a glance

What this is: This analysis explains how Azure IMDS can turn a single VM foothold into trusted managed identity abuse and broader cloud compromise.

Why it matters: It matters because cloud IAM teams must govern workload identities, not just user access, or a local execution issue can become environment-wide privilege abuse.

By the numbers:

👉 Read Unosecur's analysis of Azure managed identity token abuse via IMDS


Context

Azure Managed Identity abuse is a workload identity problem, not a software vulnerability problem. The attacker first needs code execution on a VM, then the local Instance Metadata Service can issue a trusted token that inherits the VM’s permissions, which makes over-scoped identities the real security boundary.

That matters because cloud programmes often protect the perimeter and the host, but not the identity attached to the workload. When managed identities are granted broad RBAC rights, a single compromised process can become a cloud control-plane actor with no password or MFA step to interrupt it.


Key questions

Q: What breaks when Azure managed identities are over-privileged?

A: Over-privileged managed identities turn a single VM compromise into trusted cloud access. Once an attacker can query IMDS, the returned token can be replayed against Azure APIs with the identity’s full RBAC scope. The break is in the entitlement model, because the token is legitimate even when the process using it is not.

Q: Why do managed identities increase lateral movement risk in Azure?

A: Managed identities increase lateral movement risk when they are granted permissions beyond the workload’s narrow purpose. An attacker who controls one VM can use the identity to reach Key Vault, run commands on other systems, or alter cloud resources without re-authenticating. That is why scope, not token issuance, drives the risk.

Q: How do security teams know if IMDS abuse is happening?

A: Look for requests to the metadata endpoint from unusual processes, followed by Azure activity that does not match the workload’s normal behaviour. A strong signal is a VM execution event, then IMDS access, then a new resource action by the same identity. Correlation matters more than any single log line.

Q: Who is accountable when a managed identity is abused?

A: Accountability usually sits with the cloud and identity teams together. Platform owners control how the VM and metadata service are exposed, while IAM teams control RBAC scope and lifecycle review. If the identity can act beyond its workload’s purpose, the failure is governance, not just detection.


Technical breakdown

Why IMDS becomes a trust shortcut for managed identities

Azure Instance Metadata Service, or IMDS, is the local endpoint a workload uses to obtain a managed identity token. The service does not prove the requesting process is benign in the human sense. It assumes anything running on the VM is inside the trust boundary. That design is efficient for workloads, but it means the real security decision happens earlier, when the identity is scoped. If the managed identity is over-privileged, IMDS simply hands over a token that can act across Azure APIs as a legitimate workload.

Practical implication: treat the VM as an identity issuer boundary and constrain the managed identity before deployment.

How token replay turns local execution into cloud control

Once the token is retrieved, the attacker can replay it in Azure API calls using bearer authentication. At that point, the activity looks like a legitimate service principal using its normal permissions. The danger is not token theft alone, but what the token can do if the RBAC assignment is broad enough to reach Key Vault, RunCommand, or subscription-level resources. This is why managed identity abuse often looks like normal control-plane activity until the blast radius becomes visible.

Practical implication: monitor workload identity sign-ins and resource transitions together, not as isolated telemetry streams.

Why broad RBAC on managed identities creates lateral movement paths

Managed identities are intended to reduce secret handling, but they do not reduce privilege by default. If a VM identity can reach additional machines, storage, or secrets, the compromise expands laterally without needing a second password or a fresh login. That is a governance failure in the entitlement layer. The issue is not that the identity exists, but that it can be reused far beyond the original workload’s necessity. In cloud environments, the privileges assigned to the workload often become the attacker’s mobility plan.

Practical implication: remove Contributor and Owner-style assignments from managed identities unless the workload truly needs them.


Threat narrative

Attacker objective: The attacker wants to turn one compromised Azure VM into trusted cloud access with enough scope to steal data, change workloads, or expand into adjacent resources.

  1. Entry occurs when the attacker gains code execution on the Azure VM through RCE, SSRF, RunCommand abuse, or another local compromise path.
  2. Escalation happens when the attacker queries IMDS and retrieves a managed identity token that inherits the VM’s Azure permissions.
  3. Impact follows when that token is replayed to access Key Vault, alter workloads, or move into additional Azure resources under the same identity.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Managed identity trust was designed for a benign local process, and that assumption fails when the VM becomes attacker-controlled. IMDS treats local execution as sufficient proof of legitimacy, but that model collapses once an attacker can run code on the host. The implication is not just harder monitoring, but a rethink of what the workload boundary actually means in cloud IAM.

Over-privileged managed identities create an identity blast radius that scales faster than network segmentation can contain. The article shows that the token is only the delivery mechanism, while RBAC determines how far the attacker can move. In practice, entitlement breadth becomes the dominant factor in breach severity, which is why workload identity governance must be treated as control-plane risk, not merely access hygiene.

Runtime identity abuse in Azure is now a lifecycle problem, not a point-in-time misconfiguration. Once a managed identity is attached to a VM, it can remain an enduring privilege path unless it is actively scoped, monitored, and reviewed. That makes identity lifecycle discipline just as relevant for machines as for humans, especially where operational convenience has become the default justification for excess access.

Trusted token abuse exposes a control gap that classic credential review processes do not see. The attack does not rely on a stolen static secret, so conventional secret rotation alone will not close the gap. Practitioners need to recognise that workload-issued tokens can be legitimate, short-lived, and still dangerous when the underlying identity is granted broad control-plane reach.

Identity context matters more than token format when the goal is cloud compromise. The managed identity token is not suspicious because of how it is minted, but because of what it can authorize in the cloud estate. That is the structural lesson for NHI governance: token validity is not the same as trustworthiness, and privilege scope remains the real boundary.

From our research:

  • 79% of organisations have experienced secrets leaks, with 77% of these incidents resulting in tangible damage, according to Ultimate Guide to NHIs.
  • Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them.
  • For a broader control lens, see Ultimate Guide to NHIs , Key Challenges and Risks for the visibility and over-privilege patterns that make these attacks harder to contain.

What this signals

Identity blast radius: this is the right mental model for Azure managed identity abuse, because the attacker’s reach is determined less by token issuance than by how far the workload identity can move once compromised. The programme response is to measure entitlement scope, not just authentication volume, and to treat cloud resource adjacency as part of the identity perimeter.

The broader signal is that cloud teams need telemetry that joins workload execution, metadata access, and Azure control-plane activity. Without that correlation, a managed identity can look legitimate right up until the moment it is used to change the estate. For teams building their control framework, the NIST Cybersecurity Framework 2.0 remains a useful way to structure detect and respond coverage.

This also reinforces the value of the Ultimate Guide to NHIs as a baseline for lifecycle and privilege governance. The governance gap is not abstract, because a single over-scoped identity can become the highest-risk path in an otherwise well-managed cloud environment.


For practitioners

  • Constrain managed identities to workload-specific RBAC Remove broad Contributor and Owner assignments from Azure managed identities and replace them with the narrowest data-plane or Reader permissions the workload actually needs.
  • Correlate VM execution with IMDS token activity Alert when a VM process reaches 169.254.169.254/metadata/identity and then uses the resulting identity across new Azure resources, especially Key Vault or RunCommand.
  • Restrict local code execution paths on Azure VMs Patch RCE-prone applications, reduce SSRF exposure, and tightly control RunCommand and administrator access so attackers never reach the metadata endpoint from the host.
  • Review managed identity lifecycle after every workload change Reassess entitlements whenever a VM is repurposed, scaled, or handed to another team, because stale managed identity permissions become persistent cloud access paths.

Key takeaways

  • Azure managed identity abuse is an identity governance failure, not a CVE problem, because the attacker inherits legitimate cloud permissions from a compromised VM.
  • The scale of risk comes from the entitlement layer, where broad RBAC can turn a local foothold into Key Vault access, workload control, and lateral movement.
  • Practitioners should narrow managed identity scope, correlate IMDS activity with VM execution, and review workload entitlements whenever cloud roles or hosts change.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-03Managed identity over-privilege and token abuse map directly to NHI scope and lifecycle failures.
NIST CSF 2.0PR.AC-4Least-privilege access control is central to preventing IMDS-issued token misuse.
NIST Zero Trust (SP 800-207)PR.AC-5The attack exploits a trusted local boundary that zero trust must continuously validate.

Limit managed identity scope, review entitlement drift, and remove unused permissions from Azure workloads.


Key terms

  • Azure Managed Identity: A managed identity is a cloud-assigned identity that lets an Azure workload authenticate to services without storing passwords or API keys. It is useful for reducing secret handling, but its permissions must still be tightly governed because the identity can act with whatever access is granted to it.
  • Instance Metadata Service: Instance Metadata Service, or IMDS, is the local endpoint a cloud workload uses to obtain identity and configuration data. In abuse scenarios, it becomes a token source for anyone who can execute code on the host, which is why host hardening and identity scope must be managed together.
  • Workload Identity: Workload identity is the identity assigned to software, infrastructure, or a machine rather than a person. It should be scoped to the exact tasks the workload must perform, because broad permissions can turn normal automation into a high-impact compromise path if the workload is taken over.

What's in the full article

Unosecur's full blog covers the operational detail this post intentionally leaves for the source:

  • A step-by-step view of the Azure IMDS token abuse sequence from VM foothold to replayed bearer token
  • Specific Azure log sources and correlation patterns for spotting suspicious metadata access
  • Mitigation guidance for tightening RBAC, restricting RunCommand, and reducing SSRF exposure
  • Examples of how the attack expands into Key Vault access and broader control-plane abuse

👉 Unosecur's full post covers the attack chain, detection signals, and mitigation guidance in Azure environments

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on 2026-06-04.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org