All vulnerabilities
CRITICALAppSecexploited in the wild

APPSEC-NOAUTH-2023

Web app · Microsoft Entra ID (Azure AD) OAuth/OIDC apps

Summary

nOAuth, disclosed by Descope's security team on June 20, 2023 (reported to Microsoft on April 11, 2023), is a cross-tenant account-takeover class in multi-tenant Microsoft Entra ID (Azure AD) OAuth applications, mapping to OWASP API2:2023 Broken Authentication. The flaw existed because Entra ID emitted an 'email' claim in the OIDC token that was both mutable and unverified, while applications used that email rather than the immutable 'sub'/'oid' claim to identify and link the signed-in user. An attacker who controlled their own Entra tenant could set the email attribute of an attacker account to a victim's email address, then use 'Log in with Microsoft' against any vulnerable app; the app merged accounts by the spoofed email and granted full control of the victim's account, requiring no interaction from the victim. Descope confirmed real exposure in major SaaS apps including a design platform with millions of monthly users. Microsoft mitigated by no longer emitting unverified email claims by default for app registrations created after June 2023 and added the xms_edov claim and a RemoveUnverifiedEmailClaim flag.

How to avoid it in your code

  • Identify users by the immutable 'sub'/'oid' claim, never by the unverified 'email' claim.
  • Never auto-link or merge accounts based on an email value that is not provably verified.
  • Check xms_edov or equivalent domain-ownership signals before trusting an email claim.
  • Validate iss/aud/exp and the token issuer's tenant before establishing a session.
  • Treat any OIDC claim as untrusted input until cryptographically and semantically verified.

References

Related vulnerabilities

All AppSec →