1. Resources
  2. Identity Threats
  3. Microsoft Entra ID

Entra ID Dynamic Group Membership Rule Abuse

Also known as: Dynamic group abuse, Dynamic membership rule abuse, Dynamic group privilege escalation, Attribute-based group membership abuse

An attacker who can change an attribute that a dynamic membership rule reads, or the rule itself, makes an account a member of the group and inherits every access the group grants.

Platform
Microsoft Entra ID
Impact
High
Last updated
Attack difficulty
Medium
Detection difficulty
Medium
Privileges required: Any authenticated identity
Write access to a user or device attribute that the rule evaluates, which can be the user's own synced attribute, or a role that edits the rule: Groups Administrator or User Administrator.
What the attacker gains
Membership of a dynamic group without anyone adding the member: application access, Azure roles, licenses or a Conditional Access exclusion that the group carries.
Threat groups
LAPSUS$Scattered SpiderStorm-0501HAFNIUMLazarus GroupNIMBUS MANTICORETeamPCPVOID MANTICOREGroups that MITRE ATT&CK records using T1098.003, T1098.

How it works

A dynamic membership group has no member list that anyone edits. It has a rule, such as user.department -eq "Finance" or device.deviceOwnership -eq "Company", and Microsoft Entra ID adds every user or device that satisfies the rule and removes those that stop satisfying it. Nobody can add or remove a member by hand. It is attribute-based access control applied to group membership.

That moves the question of who controls the group. For an assigned group it is whoever can edit its members. For a dynamic group it is whoever can write the attributes the rule reads, plus whoever can write the rule. Microsoft's documentation states it directly: the security of the group's membership depends on who can modify the attributes referenced in the rule, both in Entra ID and in any connected source directory.

There are three ways in.

Control of an attribute

The attacker changes an attribute on an account they control so that it matches the rule. Who can write a given attribute is often wider than the group's owner assumed:

  • The user. Some attributes synchronized from on-premises Active Directory allow users to modify their own values. A rule on such an attribute lets any synced user join the group by editing their own account on-premises and waiting for synchronization.
  • Helpdesk and user administration roles, which update profile attributes as routine work. A person who can't touch a privileged group can still set the department that puts an account into it.
  • Whoever controls the source. HR systems, provisioning connectors and the on-premises directory feed attributes into Entra ID. Compromising the source is compromising every rule that trusts it.
  • External identities. A rule that doesn't test user.userType also matches guests. If it matches on a string in the user principal name, mail address or display name, values that for a guest come from outside the tenant, an invited guest can satisfy it.

Control of the rule

An identity that can manage dynamic groups edits the rule so that it includes the attacker's account, for example by adding or (user.userPrincipalName -eq "alice@corp.example.com"). Microsoft's own example of the risk is an administrator who can modify dynamic groups adding themselves to a group that carries access they were never meant to have. Changing a rule re-evaluates the whole group: users who no longer match are removed and matching users are added.

Freezing the membership

Rule processing can be paused. While membershipRuleProcessingState is Paused, membership stops updating. An attacker who has become a member pauses processing, reverts the attribute to its original value, and stays in the group although they no longer match the rule.

What a dynamic group can carry

Dynamic groups can't hold Entra directory roles. Microsoft requires role-assignable groups to have assigned membership, and PIM for Groups doesn't manage dynamic groups. Everything else a group can do remains: assignments to enterprise applications, Azure role assignments on subscriptions and resources, licenses, Intune policies, and inclusion in or exclusion from Conditional Access policies. Membership of a group that is excluded from an MFA policy is worth as much to an attacker as many roles.

Prerequisites

  • A dynamic group whose membership grants something useful.
  • One of: write access to an attribute in that group's rule on an account the attacker controls (directly, through a role, or through the attribute's source system); or a role that can edit dynamic group rules, such as Groups Administrator or User Administrator.
  • Time. The change takes effect when the background evaluation runs.
  • Read access to the directory to find the groups and rules, which any member user normally has.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

The steps below are for an authorized assessment or a lab.

1. Find dynamic groups and read their rules

az rest --method get \
  --url "https://graph.microsoft.com/v1.0/groups?\$select=id,displayName,groupTypes,membershipRule,membershipRuleProcessingState" \
  --query "value[?membershipRule]"

For each rule, note the attributes it reads, then find out what the group grants: application assignments, Azure role assignments, and Conditional Access policies that include or exclude it. A group named for administrators or for a policy exception, with a rule on a free-text attribute, is the target.

2. Change the attribute

With rights to update the user in Entra ID:

az rest --method patch \
  --url "https://graph.microsoft.com/v1.0/users/alice@corp.example.com" \
  --body '{"department": "Cloud Platform Admins"}'

For an account synchronized from Active Directory, the attribute is written on-premises and arrives with the next synchronization cycle:

Set-ADUser -Identity alice -Department 'Cloud Platform Admins'

3. Or change the rule

With a role that manages groups, extend the rule. Keep the original condition so existing members aren't removed:

az rest --method patch \
  --url "https://graph.microsoft.com/v1.0/groups/<group id>" \
  --body "{\"membershipRule\": \"(user.department -eq 'Cloud Platform Admins') or (user.userPrincipalName -eq 'alice@corp.example.com')\"}"

4. Wait for evaluation and confirm

az rest --method get \
  --url "https://graph.microsoft.com/v1.0/groups/<group id>/members?\$select=id,userPrincipalName"

Membership is updated by a background process. Check again later if the account isn't listed yet.

5. Optionally freeze the result

az rest --method patch \
  --url "https://graph.microsoft.com/v1.0/groups/<group id>" \
  --body '{"membershipRuleProcessingState": "Paused"}'

Pausing requires a role that manages groups; group owners without such a role can't change this setting. With processing paused, the attribute can be set back without losing membership.

6. Use the group's access

Sign in again so that tokens and policy evaluation reflect the new membership, then use what the group carries: the application, the Azure role, or the sign-in that the Conditional Access exclusion now lets through.

Impact

The attacker gains whatever the group was built to grant, and the gain looks automatic: no administrator added them, and the group's member list shows them next to everyone who matches the rule legitimately. Where the group carries an Azure role, that is control of cloud resources. Where it is a policy exclusion, it removes MFA or device requirements for the attacker's account. Because the membership renews itself as long as the attribute or rule stays in place, it is also persistence that survives a manual clean-up of group members, which a dynamic group doesn't allow anyway.

OPSEC and artifacts

  • An attribute change is ordinary. Department and title updates happen every day. The audit log records "Update user" with the changed property and the actor, but nothing in that record says a membership rule depends on the value. Operators choose the attribute path over the rule path for this reason.
  • On-premises changes are attributed to synchronization. When the attribute is changed in Active Directory, the cloud audit record shows the synchronization service as the actor. The person who made the change is visible only in on-premises directory change auditing, if it is enabled.
  • The membership change has no human actor. The addition to the group is made by the dynamic membership process, so reviews that look for "who added this member" find no one.
  • A rule change is rare and specific. Editing the rule or pausing processing writes a group update with the dynamic group properties that changed. Few tenants see many of these, so operators avoid it when an attribute will do.
  • The delay cuts both ways. The attacker has to wait for evaluation, and the gap between the attribute change and the membership makes the two harder to connect in a timeline.
  • Paused processing stays visible. The group's processing state remains Paused until someone resumes it, and the admin center shows "Update paused" on the group.

Detection

  • Rule and processing changes. The dynamic group membership rule rules alert on Set dynamic group properties. Treat every hit on a group that grants access as a change that needs an owner's confirmation.
  • Updates to rule attributes. Keep a list of the attributes that sensitive rules read and watch Update user records that modify them, with extra weight when the actor is the same user, a helpdesk role, or an account that doesn't normally maintain profiles.
  • New members of sensitive dynamic groups. Compare membership snapshots for the few dynamic groups that carry roles, application access or policy exclusions.
  • Guests in member-only groups. Guest invitations and guest accounts promoted to member that are followed by membership of an internal group.
  • Policy scope. Conditional Access policy changes that add a dynamic group as an exclusion create the exposure in the first place.

User and group updates that touch rule inputs or rules:

AuditLogs
| where ActivityDisplayName in~ ("Update user", "Update group", "Set dynamic group properties")
| mv-expand Target = TargetResources
| mv-expand Property = Target.modifiedProperties
| extend PropertyName = tostring(Property.displayName)
| where ActivityDisplayName !~ "Update user"
    or PropertyName in~ ("Department", "JobTitle", "CompanyName", "PhysicalDeliveryOfficeName")
| project ActivityDateTime, Id, ActivityDisplayName, Result, InitiatedBy,
          TargetName = tostring(Target.displayName), TargetId = tostring(Target.id),
          PropertyName, OldValue = tostring(Property.oldValue), NewValue = tostring(Property.newValue)
| order by ActivityDateTime asc

Replace the property list with the attributes your own rules read, using the names as they appear in your audit records. A changed attribute proves an input changed, not that membership followed: confirm with a membership reading taken after evaluation.

Mitigation

  • Don't use dynamic groups for privileged access. Use assigned groups with reviewed membership for Azure roles at high scopes, administrative applications and Conditional Access exclusions. Microsoft made this mandatory for directory roles; apply the same rule to everything else that matters.
  • Audit who can write each attribute a rule reads, in Entra ID and at the source. Microsoft's guidance is to restrict self-service write access to attributes used in security-sensitive groups. On-premises, remove self-write permission on those attributes; the Entra Connect hardening guide covers the synchronization side.
  • Prefer attributes that only a trusted system writes, such as values provisioned from HR, over free-text profile fields. Avoid -contains and -match on names and addresses.
  • Exclude guests explicitly. Add (user.userType -eq "Member") to every rule that isn't meant for external users.
  • Limit who can edit rules. Review holders of Groups Administrator, User Administrator and other roles that manage groups, and scope them with administrative units where possible.
  • Put sensitive groups in a restricted management administrative unit so that tenant-wide group and user administrators can't modify them.
  • Review membership on a schedule for the dynamic groups that carry access, and investigate any group whose processing is paused.
  • Export the audit log so that rule changes and attribute changes can be tied together across the hours or days between them.

Detection rules for this attack

Log events to collect

FAQ

Can a dynamic group give someone an Entra directory role?

No. Only role-assignable groups can hold a directory role, and Microsoft requires their membership to be assigned, not dynamic, for exactly this reason. Dynamic groups can still carry Azure role assignments, application assignments, licenses, Intune policies and Conditional Access inclusions or exclusions, and those are what this attack reaches.

Which attributes are risky in a dynamic membership rule?

Any attribute that someone other than a trusted administrator can write. Microsoft's guidance calls out attributes synchronized from on-premises Active Directory, some of which users can change on their own account, and any attribute used in a group that controls access to sensitive resources or Conditional Access. Department, job title, office and extension attributes are common examples.

How quickly does a membership change take effect?

Not immediately. Membership is recalculated in a background process when an attribute or the rule changes. Microsoft says changes are typically processed within a few hours and can take more than 24 hours in large or busy tenants. In a small directory it is often minutes.

How do I detect dynamic group abuse?

Alert on every change to a dynamic group's rule or processing state, which is rare and recorded in the audit log. For attribute changes, watch updates to the specific attributes your sensitive rules read, especially when the actor is the user themselves, a helpdesk role or the synchronization service after an on-premises change.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.