Skip to content
Threat Feed
medium advisory

Detection of Unusual OAuth Application Access to SharePoint and OneDrive

This brief details a detection strategy for identifying potential OAuth phishing and illicit consent grants by monitoring for first-time application access to Microsoft 365 file storage.

Adversaries increasingly leverage malicious OAuth applications to gain persistent, unauthorized access to organizational data without traditional credential theft. By tricking users into granting consent to seemingly benign or productivity-focused applications, threat actors secure OAuth tokens that permit access to Microsoft SharePoint Online and OneDrive for Business. This activity persists even if the user's password is changed or MFA is enforced. This detection targets the 'first-time' access signal, identifying new or anomalous application identifiers (AppIDs) appearing within a tenant's sign-in logs. Defenders must distinguish between legitimate third-party SaaS integrations and malicious applications used for data exfiltration or reconnaissance.

Impact

Successful exploitation allows attackers to bypass MFA and bypass conditional access policies, leading to large-scale data exfiltration, unauthorized document discovery, and long-term persistence within a target environment. This technique is frequently utilized in organized phishing campaigns to automate the harvesting of sensitive intellectual property or business communications.

Recommendation

  • Implement the detection of new, unseen AppIDs interacting with SharePoint Online and OneDrive for Business to baseline and alert on anomalous consent grants.
  • Review and prune high-privilege OAuth permissions such as 'Files.ReadWrite.All' or 'Sites.ReadWrite.All' that exceed organizational requirements.
  • Strengthen Conditional Access policies to mandate admin consent for risky applications and block unverified publishers from accessing sensitive resources.
  • Audit existing enterprise application consents to identify and revoke access for suspicious, unused, or unverified applications.

Immediate actions

Deploy the new-terms detection rule to monitor for unusual OAuth access.

Detection Engineering 48h

Mitigations

Review and prune high-privilege application consents.

short_term Identity Security

Illicit OAuth consent grants

Detection coverage 1

Detect First-Time SharePoint or OneDrive Access by Unusual Client

medium

Detects when an application accesses SharePoint Online or OneDrive for Business for the first time in the tenant, which may indicate an illicit OAuth consent grant.

sigma tactics: collection techniques: T1213.002 sources: webserver, windows

Detection queries are available on the platform. Get full rules →