Skip to content
Access control Write-up Intermediate

Abusing dynamic groups in Azure AD for privilege escalation

A low-privileged Azure AD user could escalate privileges by inviting a guest account whose email address contained a string used in a dynamic group membership rule, causing the guest to inherit the group's Azure RBAC role. The attacker could then gain VM Contributor access to the subscription.

mnemonic.no

Published on mnemonic.no

mnemonic researchers have discovered a new technique for escalating privileges within Azure environments through the abuse of dynamic groups in Azure Active Directory. Organizations that employ dynamic groups for assigning user roles and rights should review their Azure Active Directory configuration to ensure they…

The author, on mnemonic.no

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the dynamic group membership rule was based on a user-controlled attribute (the UPN/email), and by default any user could invite guest accounts, allowing an attacker to create a guest with a matching attribute.

Impact

The attacker could gain VM Contributor access to the Azure subscription, allowing them to manage virtual machines and potentially bypass network and host-level security controls.

What the attacker needed

A low-privileged Azure AD account (Global Reader); default guest invite permissions enabled; a dynamic group rule based on a user-controlled attribute

The fix

Dynamic group membership rules should not be based on user-controlled attributes, and organisations should consider disabling the ability for all users to invite guest accounts.

How it was found

  1. The attacker starts with a Global Reader role in Azure AD.
  2. The attacker finds a dynamic group with the VM Contributor role assigned, where membership is based on the string 'bluefish' in the UPN.
  3. The attacker invites a guest Gmail account with 'bluefish' in the address.
  4. The guest account triggers the dynamic group after accepting, and inherits the VM Contributor role in Azure RBAC.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

In cloud systems like Azure, groups are often used to give people permissions. Some groups are 'dynamic', meaning membership is decided automatically by a rule based on user details, such as their email address. If an attacker can create a new account with a detail that matches the rule, they can join the group and get its permissions without being explicitly added.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.