1. Resources
  2. Detection rules
  3. UPN or SPN Collision With Another Account

UPN or SPN Collision With Another Account detection rules

An attacker who can write an account's naming attributes gives it a user principal name or service principal name that collides with another account, so sign-ins or tickets meant for that account resolve to theirs.

Platform
Active Directory
Severity
High
Log source
Directory Service event log (domain controllers), Windows Security event log
Last updated
MITRE ATT&CK technique
T1098Account Manipulation
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Write access to the user principal name or the service principal names of an account, for example GenericWrite on a user or computer object.
Impact
The attacker's account is taken for another account at sign-in or when a service ticket is issued, which can end in control of the domain or of a service.
Response
Restore the changed name, disable the account that wrote it, and revoke the certificates issued while the collision existed.
Mitigation
Install the March and April 2026 updates on every domain controller, and limit who can write the naming attributes of other accounts.
Event IDs
2974474251364738

How the attack works

Two attributes tell Active Directory which account a name belongs to. userPrincipalName (UPN) holds the sign-in name of an account and is one of the names a certificate can be mapped by. servicePrincipalName (SPN) holds the service names that Kerberos issues tickets for. Each value has to point to exactly one account, and domain controllers running Windows Server 2012 R2 or later refuse a write that would create a duplicate UPN or SPN. Both attributes can be changed by anyone with write access to the account, and GenericWrite on a user or computer object is enough.

The attack is to make a name collide in a way that check does not see. The check compares a UPN with other UPNs. A UPN set to the bare logon name (sAMAccountName) of another account is not a duplicate for it, although a component that looks an account up by name can then land on the wrong one. Microsoft named conflicts between UPNs and sAMAccountName as a source of spoofing in certificate authentication (KB5014754), and CVE-2026-27912, fixed on April 14, 2026 and called ResetNightmare by the researchers who reported it, started with a UPN set to the logon name of the target. On the SPN side, CVE-2026-25177 (fixed on March 10, 2026, reported as KerberLoss) let an SPN that differs from an existing one only by a character that does not display pass the uniqueness check, while name resolution treated the two as the same service.

The logs show the write. Event 5136 records the new value when an auditing entry (SACL) covers the attribute, event 4738 shows a changed UPN of a user without any SACL, and event 4742 does the same for a computer account, where Microsoft notes that a UPN is typically not set. When a domain controller blocks a plain duplicate it writes event 2974 to its Directory Service log. The rules on this page read those events. An SPN with a hidden character looks like an ordinary value in an event, so that case is described under Detection logic.

What an attacker needs

  • Write access to userPrincipalName or servicePrincipalName of an account, for example GenericWrite on a user or computer object, or the right to create such objects.
  • For sign-in with a certificate under a borrowed UPN: a domain controller or Schannel server that still maps certificates by UPN, and a template the attacker can enroll in.
  • For CVE-2026-27912 and CVE-2026-25177: domain controllers without the April 14, 2026 and March 10, 2026 updates.

Impact

The attacker's account is taken for another account. With a borrowed UPN that has meant a certificate or a password change that applies to the target, and the researchers who reported CVE-2026-27912 describe a path from GenericWrite on any user or computer object to control of the domain. With a colliding SPN, service tickets are encrypted for the wrong account, which breaks Kerberos for the service, pushes its clients to NTLM, or redirects a constrained delegation to a service the attacker controls.

Detection rules

Domain Controller Blocked a Duplicate UPN or SPN

Detects event 2974 in the Directory Service log of a domain controller. Domain controllers running Windows Server 2012 R2 or later refuse a write that would give a second object a user principal name or service principal name that already exists, and log this event with the value that was blocked and up to ten objects that already hold it. Microsoft recommends reviewing the event to identify attempts to create duplicate UPNs or SPNs. One event is a blocked attempt to take over a name that belongs to another account, or an administrator's mistake. The rule matches on the event alone, because Microsoft documents the content of the event as text and not as named fields, so the level is one step lower and the event text has to be read to see which value and which objects are involved. A write that passes the check, such as an SPN with a hidden character on a domain controller without the March 10, 2026 update, does not produce this event.

LevelMediumStatusExperimentalLog sourceDirectory Service event log (domain controllers)
title: Domain Controller Blocked a Duplicate UPN or SPN
id: b96b7e30-8e43-4d98-8b4e-00c29942b996
status: experimental
description: >-
  Detects event 2974 in the Directory Service log of a domain controller.
  Domain controllers running Windows Server 2012 R2 or later refuse a write
  that would give a second object a user principal name or service principal
  name that already exists, and log this event with the value that was
  blocked and up to ten objects that already hold it. Microsoft recommends
  reviewing the event to identify attempts to create duplicate UPNs or SPNs.
  One event is a blocked attempt to take over a name that belongs to another
  account, or an administrator's mistake. The rule matches on the event
  alone, because Microsoft documents the content of the event as text and
  not as named fields, so the level is one step lower and the event text has
  to be read to see which value and which objects are involved. A write that
  passes the check, such as an SPN with a hidden character on a domain
  controller without the March 10, 2026 update, does not produce this event.
references:
  - https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/spn-and-upn-uniqueness
  - https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-25177
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: windows
  service: directory-service
detection:
  selection:
    Provider_Name|contains: DomainService
    EventID: 2974
  condition: selection
falsepositives:
  - Administrators and deployment scripts that try to register an SPN or UPN that another object still holds, for example when a service moves to a new account before the old registration was removed. Remove the old value and repeat the change.
  - Restoring or renaming an object whose name is in use again, which the domain controller blocks in the same way.
level: medium

False positives

  • Administrators and deployment scripts that try to register an SPN or UPN that another object still holds, for example when a service moves to a new account before the old registration was removed. Remove the old value and repeat the change.
  • Restoring or renaming an object whose name is in use again, which the domain controller blocks in the same way.

User Principal Name Set on a Computer Account

Detects event 4742 (a computer account was changed) in which the User Principal Name field holds a value. Microsoft's description of the event says that the attribute is optional for computer objects and typically is not set, and lists a value other than a dash in this field as a possible anomaly to monitor. A computer object is one of the accounts whose UPN an attacker with write access can point at another account's name. The new value is in UserPrincipalName, the computer in TargetUserName and the writer in SubjectUserName. Requires Audit Computer Account Management.

LevelMediumStatusExperimentalLog sourceWindows Security event log
title: User Principal Name Set on a Computer Account
id: c9e6965c-ea80-4f62-a3e5-baf5cb87467a
status: experimental
description: >-
  Detects event 4742 (a computer account was changed) in which the User
  Principal Name field holds a value. Microsoft's description of the event
  says that the attribute is optional for computer objects and typically is
  not set, and lists a value other than a dash in this field as a possible
  anomaly to monitor. A computer object is one of the accounts whose UPN an
  attacker with write access can point at another account's name. The new
  value is in UserPrincipalName, the computer in TargetUserName and the
  writer in SubjectUserName. Requires Audit Computer Account Management.
references:
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4742
  - https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4742
  filter_unchanged:
    UserPrincipalName: '-'
  condition: selection and not filter_unchanged
falsepositives:
  - Domain join tools and appliances that register a principal name on their own computer account. Learn which computers carry a UPN and exclude the accounts that write them by SubjectUserName.
  - Collectors that drop the field or deliver it empty when the UPN did not change. Check a few events 4742 from your own pipeline and add a filter for the empty value if you see it.
level: medium

False positives

  • Domain join tools and appliances that register a principal name on their own computer account. Learn which computers carry a UPN and exclude the accounts that write them by SubjectUserName.
  • Collectors that drop the field or deliver it empty when the UPN did not change. Check a few events 4742 from your own pipeline and add a filter for the empty value if you see it.

User Principal Name Without a Domain Part Written to an Account

Detects a value added to userPrincipalName that contains no @ sign (event 5136, Value Added). Microsoft describes the user principal name as an internet-style login name based on RFC 822, so a value without a domain part is not a normal UPN. It is what the attribute looks like when it is set to the bare logon name of another account, the collision between UPN and sAMAccountName that Microsoft names as a source of spoofing in KB5014754 and the first step that the researchers who reported CVE-2026-27912 describe. The new value is in AttributeValue and the changed account in ObjectDN. A UPN that borrows a name and keeps a domain part is not matched. Requires Audit Directory Service Changes and a SACL that audits writes of the attribute on user and computer objects.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: User Principal Name Without a Domain Part Written to an Account
id: 14a9a398-02bd-48a6-a2f0-ff2cf90017f0
status: experimental
description: >-
  Detects a value added to userPrincipalName that contains no @ sign (event
  5136, Value Added). Microsoft describes the user principal name as an
  internet-style login name based on RFC 822, so a value without a domain part
  is not a normal UPN. It is what the attribute looks like when it is set to
  the bare logon name of another account, the collision between UPN and
  sAMAccountName that Microsoft names as a source of spoofing in KB5014754 and
  the first step that the researchers who reported CVE-2026-27912 describe.
  The new value is in AttributeValue and the changed account in ObjectDN. A
  UPN that borrows a name and keeps a domain part is not matched. Requires
  Audit Directory Service Changes and a SACL that audits writes of the
  attribute on user and computer objects.
references:
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5136
  - https://learn.microsoft.com/en-us/windows/win32/adschema/a-userprincipalname
  - https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
  - https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-27912
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5136
    AttributeLDAPDisplayName: userPrincipalName
    OperationType:
      - '%%14674'
      - 'Value Added'
  filter_domain_part:
    AttributeValue|contains: '@'
  condition: selection and not filter_domain_part
falsepositives:
  - A provisioning script or an administrator that writes a UPN without its suffix by mistake. Correct the value and the script. There is no routine reason to keep such a UPN.
level: high

False positives

  • A provisioning script or an administrator that writes a UPN without its suffix by mistake. Correct the value and the script. There is no routine reason to keep such a UPN.

User Account Changed to a User Principal Name Without a Domain Part

Detects event 4738 (a user account was changed) in which the User Principal Name field holds a new value that contains no @ sign. The field shows a dash when the UPN was not part of the change and the new value when it was. A UPN without a domain part is what the attribute looks like when it is set to the bare logon name of another account, the collision between UPN and sAMAccountName that Microsoft names as a source of spoofing in KB5014754. This rule reads the same change as the rule on event 5136 but needs no SACL, only Audit User Account Management. The changed account is in TargetUserName and the writer in SubjectUserName.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: User Account Changed to a User Principal Name Without a Domain Part
id: dd0dacf9-f165-4e1e-8a47-085f9f5f7eb3
status: experimental
description: >-
  Detects event 4738 (a user account was changed) in which the User Principal
  Name field holds a new value that contains no @ sign. The field shows a
  dash when the UPN was not part of the change and the new value when it was.
  A UPN without a domain part is what the attribute looks like when it is set
  to the bare logon name of another account, the collision between UPN and
  sAMAccountName that Microsoft names as a source of spoofing in KB5014754.
  This rule reads the same change as the rule on event 5136 but needs no
  SACL, only Audit User Account Management. The changed account is in
  TargetUserName and the writer in SubjectUserName.
references:
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4738
  - https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
  - https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-27912
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4738
  filter_unchanged:
    UserPrincipalName: '-'
  filter_domain_part:
    UserPrincipalName|contains: '@'
  condition: selection and not 1 of filter_*
falsepositives:
  - A provisioning script or an administrator that writes a UPN without its suffix by mistake. Correct the value and the script.
  - Collectors that drop the field or deliver it empty when the UPN did not change. Check a few events 4738 from your own pipeline and add a filter for the empty value if you see it.
level: high

False positives

  • A provisioning script or an administrator that writes a UPN without its suffix by mistake. Correct the value and the script.
  • Collectors that drop the field or deliver it empty when the UPN did not change. Check a few events 4738 from your own pipeline and add a filter for the empty value if you see it.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

UPN written whose name part equals the logon name of another account

Detection hypothesisNeeds your own listsCompares with an earlier value

A UPN with a domain part passes the rule on this page even when its name part was taken from a privileged account that has no UPN of its own. The collision only shows when the new value is compared with the logon names that already exist in the directory.

  1. A UPN is written: event 5136 with AttributeLDAPDisplayName userPrincipalName and OperationType Value Added, or event 4738 in which UserPrincipalName is not a dash. Keep the new value, the changed account and SubjectUserName.
  2. Take the part of the value before the @ sign, or the whole value when there is none.
  3. Compare it with your own export of the sAMAccountName values of privileged accounts and domain controllers. A match on an account other than the one that was changed is the finding.
  4. Raise the priority when SubjectUserName is not the provisioning account that normally maintains UPNs.

Events51364738

LimitsThe list of logon names has to come from your own directory and has to be current. Accounts that are renamed on purpose, for example after a merger, can produce a match with a retired name. Event 5136 needs an auditing entry on the changed object.

UPN changed and restored around a certificate request

Detection hypothesisSequence of events

An attacker who borrows a name needs it only for the moment a certificate is requested or a credential is changed, and puts the old value back so that the account looks untouched. A routine UPN change is not reversed within the hour.

  1. The UPN of an account changes: event 5136 with AttributeLDAPDisplayName userPrincipalName, one event with OperationType Value Deleted for the old value and one with Value Added for the new one, same ObjectDN.
  2. Within 60 minutes the same ObjectDN receives a Value Added event whose AttributeValue equals the value that was deleted in the first step.
  3. Between the two changes, look on the CA for a certificate issued to that account (event 4887, Requester) and on the domain controllers for event 4768 in which CertThumbprint is not empty.

Events513648874768

LimitsAn administrator who corrects a typing mistake also changes a UPN twice in a short time. The 60 minutes are a starting point. The CA events exist only when Audit Certification Services and the CA audit filter are enabled.

New SPN that equals an existing SPN once characters that do not display are removed

Detection hypothesisCompares with an earlier valueNeeds your own lists

CVE-2026-25177 allowed an SPN that differs from an existing one only by a character that does not display. The domain controller did not block it, so no event 2974 exists, and the value in event 5136 looks like a normal SPN. Comparing the raw value with the SPNs already in the directory shows the shadow.

  1. An SPN is written: event 5136 with AttributeLDAPDisplayName servicePrincipalName and OperationType Value Added. Keep AttributeValue and ObjectDN.
  2. Remove every character from the value that is not a printable character, and compare the result with your own export of the SPNs of all accounts.
  3. A match with an SPN on a different object, while the raw value is not identical to it, is the finding. An identical raw value on two objects is an ordinary duplicate.

Events5136

LimitsWhether the collection pipeline keeps such a character in the event depends on the collector and the SIEM, so test it with a harmless value first. The SPN export has to be current. Legitimate duplicates exist in many directories and are not what this comparison looks for.

Triage

  • Read the account that was changed (ObjectDN or TargetUserName), the new value (AttributeValue or UserPrincipalName) and the account that wrote it (SubjectUserName, SubjectLogonId).
  • Compare the new value with the logon names, UPNs and SPNs of other accounts. A match with a privileged account or a domain controller is the collision this page is about.
  • For event 2974, read the blocked value and the objects that already hold it in the event text, and find who was connected to that domain controller at that time (event 4624).
  • Look at what followed. Examples are a certificate issued to the changed account (event 4887 on the CA), a ticket-granting ticket obtained with a certificate (event 4768 with certificate fields) and a password change of the account whose name was borrowed.
  • Check whether the earlier value was restored shortly afterwards, and whether a change record or the provisioning system explains the write.

Response

Once the attack is confirmed:

  1. Restore the original UPN, or remove the SPN, so that the name belongs to one account again.
  2. Disable or reset the account that wrote the value and remove the write access that allowed it.
  3. Revoke every certificate that was issued to the changed account while it carried the borrowed name. A password reset of the impersonated account does not invalidate them.
  4. Reset the password of the account whose name was borrowed if it changed during that time, and review what was done as that account. For a privileged account, handle it as a domain compromise.
  5. For an SPN, confirm that the real service obtains working tickets again and review the delegation settings that reference that SPN.

Mitigation

  • Install the March 10, 2026 and April 14, 2026 security updates on every domain controller. They fix CVE-2026-25177 and CVE-2026-27912.
  • Keep every domain controller on the September 9, 2025 or later updates, which refuse certificates without a strong mapping, and leave the Schannel CertificateMappingMethods value at its default so that UPN mapping stays off.
  • Review who can write userPrincipalName and servicePrincipalName on accounts other than their own, and remove GenericWrite and GenericAll that broad groups hold on users and computers.
  • Add auditing entries (SACL) for writes of both attributes on user and computer objects, enable Audit Directory Service Changes on all domain controllers and collect their Directory Service log.
  • Review event 2974 regularly, as Microsoft recommends, and clean up the duplicate names it lists.

Frequently asked questions

Why does a domain controller accept a UPN that equals another account's logon name?

The uniqueness check that Microsoft documents blocks a duplicate user principal name and a duplicate service principal name. It does not compare a UPN with the sAMAccountName of other accounts. Microsoft names conflicts between UPNs and sAMAccountName as a source of spoofing in KB5014754, which is why a UPN without a domain part deserves attention.

Does event 2974 show an SPN with a hidden character?

Not on a domain controller that lacks the March 10, 2026 update. Event 2974 is written when the domain controller blocks a duplicate, and the hidden character is what made the value pass that check. Microsoft does not document which event an updated domain controller writes for such a value, so the page treats this case as a comparison against the SPNs already in the directory.

Is every UPN change suspicious?

No. UPNs change when people change their name, when a domain suffix is replaced and when a provisioning system corrects an account. The rules on this page match narrower cases, which are a UPN without a domain part, a UPN on a computer account and a duplicate that a domain controller blocked.

Why is a UPN on a computer account unusual?

Microsoft's description of event 4742 says that the user principal name is optional for computer objects and typically is not set, and it lists a value other than a dash in that field as a possible anomaly. Some domain join tools for other operating systems do set one, so learn which of your computers carry a UPN.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.