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
userPrincipalNameorservicePrincipalNameof 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.
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.
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.
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.
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
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.
- A UPN is written: event 5136 with
AttributeLDAPDisplayNameuserPrincipalName andOperationTypeValue Added, or event 4738 in whichUserPrincipalNameis not a dash. Keep the new value, the changed account andSubjectUserName. - Take the part of the value before the @ sign, or the whole value when there is none.
- Compare it with your own export of the
sAMAccountNamevalues of privileged accounts and domain controllers. A match on an account other than the one that was changed is the finding. - Raise the priority when
SubjectUserNameis 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
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.
- The UPN of an account changes: event 5136 with
AttributeLDAPDisplayNameuserPrincipalName, one event withOperationTypeValue Deleted for the old value and one with Value Added for the new one, sameObjectDN. - Within 60 minutes the same
ObjectDNreceives a Value Added event whoseAttributeValueequals the value that was deleted in the first step. - 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
CertThumbprintis 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
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.
- An SPN is written: event 5136 with
AttributeLDAPDisplayNameservicePrincipalName andOperationTypeValue Added. KeepAttributeValueandObjectDN. - 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.
- 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:
- Restore the original UPN, or remove the SPN, so that the name belongs to one account again.
- Disable or reset the account that wrote the value and remove the write access that allowed it.
- 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.
- 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.
- 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
CertificateMappingMethodsvalue at its default so that UPN mapping stays off. - Review who can write
userPrincipalNameandservicePrincipalNameon 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
- MITRE ATT&CK T1098: Account Manipulation
- SPN and UPN uniqueness (blocked duplicates and event 2974)
- KB5014754: Certificate-based authentication changes on Windows domain controllers
- Event 5136: A directory service object was modified
- Event 4738: A user account was changed
- Event 4742: A computer account was changed
- User-Principal-Name attribute
- Service-Principal-Name attribute
- Securing PKI, Appendix A: Events to Monitor (CA event 4887)
- Event 4768: A Kerberos authentication ticket (TGT) was requested
- Microsoft Security Response Center: CVE-2026-27912
- Microsoft Security Response Center: CVE-2026-25177
- Semperis: Identity Crisis (KerberLoss and ResetNightmare)