OAuth Device-Code Phishing Has Broader Impact in Azure Than Google Cloud

· Original article ↗

Summary

A technical comparison finds Azure’s device-code flow can let attackers obtain broadly scoped tokens after phishing a user, while Google Cloud restricts available scopes, limiting the attack’s potential. The author notes undocumented options may exist.

Key points

  • Attackers can request a device code without authenticating, persuade a victim to sign in and complete MFA, then poll the authentication flow to retrieve tokens.
  • In Azure, the attacker selects the requested resource and client ID, which affects the resulting token’s scope and access.
  • The article describes Azure tokens that can access Microsoft Graph resources; it also cites prior research demonstrating device-code phishing to obtain a Primary Refresh Token.
  • Google Cloud limits device-code flow to a small set of scopes, including narrow Google Drive and YouTube permissions, which the author says substantially limits its usefulness for account takeover.
  • Google app creation and verification requirements add friction, though the author says they do not prevent attempts using the currently supported limited scopes.
  • The comparison is not definitive: the author cautions that undocumented Google client IDs or scopes could change the assessment.

Article Details

Attack Vectors
  • Device code phishing: an attacker requests an unauthenticated device code, persuades a victim by email to enter it on the legitimate sign-in page and complete authentication, then polls the authentication API to retrieve tokens.
  • In the Azure example, the attacker chooses the requested resource and client ID, which can affect the resulting token's scope and access. The article describes potential access to resources as the victim.
  • The article demonstrates the same general device-code phishing flow with Google Cloud, but reports that the supported scopes limit the usefulness of the resulting tokens compared with Azure.
Defensive Notes
  • The article notes that users may overlook the warning against entering device codes from untrusted sources when directed to a legitimate sign-in page.
  • Google's documented device-code flow supports a restricted set of scopes, which the article says limits the attack's potential compared with Azure.
  • The article says Google applications requiring too many powerful permissions must be published and verified before use.

MITRE ATT&CK

People

Vendors

Products

Related Articles