
A strong theme, but no worries.
OAuth is an authorization method that allows applications to access user resources on other platforms without sharing credentials. You may have experienced, when installing applications that work with your M365 tenant, a message asking for such authorization, or refusing and asking for permission from someone with administrative privileges.
So sometimes accessing a mailbox is not just about MFA and password, but also about clicking Allow. One researcher (Red Canary) described a scenario in which a user in the Entra ID tenant added the ChatGPT application, as a service principal and gave it Microsoft Graph permissions: mail.Read, offline_access, profile, openid.
The effect is simple: the application can read that user's mail, and thanks to offline_access maintain access through refresh tokens. Other potential threats, in my opinion, are all kinds of agents who act on your behalf on the mailbox or have permissions there. So this could be a trend for attacks based on applications using OAuth, and a particularly threatening variant appears in Entra ID.
In this case, the attackers used the legitimate ChatGPT application to abuse OAuth permissions and gain unauthorized access to company email inboxes and the data contained therein. This is therefore a leaven for further attack attempts, e.g., impersonation, reconnaissance, data collection, intelligence, etc.
This breach demonstrates the importance of properly managing OAuth consents and the risks involved when third-party applications are given too much access to user data.
The scenario begins when an employee adds a service principal object for ChatGPT to the tenant Entra ID and agrees to OAuth permissions that allow access to mail (Mail.Read) and other user data (offline_access, profile, openid).
This operation takes place through the legitimate OpenAI application, which looks like a trusted service, but in this case has been exploited by the attacker. The user gives permission, unknowingly opening the attacker's access to sensitive mail data.
The key risk lies in the Mail.Read permission request. This is a scope often used by attackers to steal email data. In this attack, such a „legitimate” request was abused, leading to unauthorized access to the victim's mailbox.
The investigation prompted the team to review the logs and correlation of events, with a particular focus on the added service principal (ChatGPT) and the specific OAuth permissions the user had agreed to.
How to avoid these mistakes:
- Limit user consent: set the consent policy so that users cannot accept applications with sensitive permissions on their own (or at all only through admin workflow).
- Enforce „step-up consent” and publisher verification: Entra can block/escalate risky consent requests (e.g. multi-tenant without verified publisher) to admin approval. Make sure this is realistically enforced and understood by the team.
- Alerts on high-risk entitlements: treat Mail.Read, Mail.Send, Files.Read*, offline_access as red flags, especially when they appear to users who „suddenly” install new applications.
- Application monitoring and governance: use app governance type mechanisms in Defender for Cloud Apps to review, approve/ban and respond to OAuth app anomalies.
- Catch consent-phishing campaigns in the mail: strengthen anti-phishing in Defender for Office 365 (it's a common launch channel: link to consent screen).
- IR response: once consent is reached, remove/disable the suspicious application (service principal), revoke grants and cut off tokens, do not end up with passwords and sessions.
- Probably a little more widely start using PAM systems to protect privileged accounts including AI agent accounts
If, in your organization, „SaaS applications can ask for anything and the user can accept it,” then you have an open door to inboxes, files and contacts without a classic account breach. That's where you lose data. AI apps of all kinds can ask for said consents, so train your employees and teach them, as always, not to click on untrusted sources and unintelligible messages.
With better monitoring and tough consent policies, the organization can better protect itself from such attacks and limit the damage from unauthorized access to data.
Do you have questions? Request a free consultation with an ISCG expert: https://outlook.office.com/book/MeetingswithISCGExperts@ISCG.onmicrosoft.com/s/4OIyaXg2FECLomR4u85ATw2?ismsaljsauthenabled
