M365 Identity Device Code Grant by an Unusual User (Non-Compliant Device)
Identifies a Microsoft 365 user completing an OAuth device code grant ("Cmsi:Cmsi") from a non-compliant device for the first time within the rule's historical window, regardless of the requesting application or…
Description
Identifies a Microsoft 365 user completing an OAuth device code grant ("Cmsi:Cmsi") from a non-compliant device for the first time within the rule's historical window, regardless of the requesting application or target resource. Device code phishing kits complete the full login (password and MFA) at the genuine Microsoft endpoint and harvest the resulting token by polling, so MFA does not stop them. Because the victim authorizes the flow in their own browser, the grant is frequently completed on a personal or attacker-controlled device that is not enrolled or compliant with the organization's device policies. A user appearing with this device code flow on a non-compliant device for the first time in the lookback window is a strong early indicator of device code phishing, and removing the application and target constraints catches grants against any first-party application, not just the Microsoft Authentication Broker.
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.
- Log source category
- event_index
Known benign triggers
- A user legitimately using the device code flow for the first time on a personal or otherwise non-compliant device, such as a smart TV, kiosk, IoT device, conference room device, or a personal laptop for a CLI or headless developer workflow. Review the source ASN, geolocation, application, and the user's device posture to confirm whether the activity is expected before escalating.
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 |
|---|---|
| arcticwolf.com/resources/blog/kali365-expands-into-aws-microsoft-okta-xerox-max-messenger/ | 2 |
| arcticwolf.com/resources/blog/token-bingo-dont-let-your-code-be-the-winner/ | 7 |
| www.ic3.gov/PSA/2026/PSA260521 | 6 |
| www.microsoft.com/en-us/security/blog/2025/02/13/storm-2372-conducts-device-code-phishing-campaign/ | 4 |
| www.volexity.com/blog/2025/02/13/multiple-russian-threat-actors-targeting-microsoft-device-code-authentication/ | 5 |
From the source
- At source
- Open at source
- Upstream identifier
- 7e2abdb3-c7b0-4e11-ba2f-6657602800a1
- Tagged by the source as
- Data Source: Microsoft 365Data Source: Microsoft 365 Audit LogsDomain: CloudDomain: EmailDomain: IdentityDomain: SaaSNoise: MediumPerformance: NormalPlatform: Microsoft 365Profile: RecommendedResources: Investigation GuideRule Type: New TermsTactic: Initial 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