Entra ID OAuth Device Code Flow with Concurrent Sign-ins
Identifies Entra ID device code authentication flows where multiple user agents are observed within the same session. This pattern is indicative of device code phishing, where an attacker's polling client (e.g.,…
Description
Identifies Entra ID device code authentication flows where multiple user agents are observed within the same session. This pattern is indicative of device code phishing, where an attacker's polling client (e.g., Python script) and the victim's browser both appear in the same authentication session. In legitimate device code flows, the user authenticates via browser while the requesting application polls for tokens - when these have distinctly different user agents (e.g., Python Requests vs Chrome), it may indicate the code was phished and redeemed by an attacker.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 3 ATT&CK techniques it maps to.
Known benign triggers
- Legitimate use of device code flow where a user authenticates via browser for a CLI tool or headless application. Common legitimate scenarios include Azure CLI, Azure PowerShell, or VS Code remote development. Review the user agent combinations - browser + known CLI tool from the same user may be expected behavior.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-azure-monitor-sign-ins-log-schema | 8 |
| learn.microsoft.com/en-us/entra/identity/ | 3 |
| learn.microsoft.com/en-us/entra/identity/monitoring-health/concept-sign-ins | 6from 2 sources |
| www.volexity.com/blog/2025/04/22/phishing-for-codes-russian-threat-actors-target-microsoft-365-oauth-workflows/ | 19 |
| www.wiz.io/blog/recent-oauth-attacks-detection-strategies | Only this detection cites it |
From the source
- At source
- Open at source
- Upstream identifier
- 3db029b3-fbb7-4697-ad07-33cbfd5bd080
- Tagged by the source as
- Data Source: AzureData Source: Entra IDData Source: Entra ID Sign-inDomain: CloudDomain: IdentityNoise: MediumPerformance: NormalPlatform: Entra IDProfile: RecommendedResources: Investigation GuideRule Type: ES|QLTactic: Credential AccessThreat: Device Code PhishingUse Case: Identity and Access AuditUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 20, 2026
- Version
- 3