
Adversaries abuse application access tokens to gain unauthorized access to cloud, container-based, or SaaS resources, as seen in OAuth consent grant attacks.
Applications generate access tokens in order to give successfully authenticated (and authorized) users and services to APIs that allow them to perform actions within cloud resources, containers, SaaS applications, and other systems. Adversaries attempt to intercept these tokens because they need access to APIs in order to accomplish their objectives in the cloud.
OAuth application consent grant attacks are a specific variety of token theft that adversaries leverage because it allows them persistent access to resources without relying on user credentials. By tricking users into granting permissions to a malicious or compromised app, adversaries can act on the user’s behalf, bypassing traditional security controls and maintaining access even if user credentials are changed or revoked.
In general, adversaries conduct adversary-in-the-middle (AitM) attacks where they steal access tokens by tricking users into disclosing their credentials by authenticating via a spoofed login page. These pages work by intercepting credentials as they are entered into the phishing page—including additional factors of authentication—and forwarding them to the adversary in real time so that they can then log into the legitimate domain. This allows the adversary to steal a token as it is issued to the user.
Adversaries also leverage stealer malware to steal both short and long-term passwords, keys, or tokens. The most recent Shai-Hulud attack is one prominent example of this, where adversaries leveraged compromised npm packages to deploy credential-stealing malware. The malware in turn used access keys stored on an infected endpoint to further enumerate cloud environments to gain access to more long-term access keys.
In the case of OAuth consent grant attacks, adversaries typically send targeted phishing emails or messages that appear to come from trusted sources, often promoting a new productivity tool or urgent business application. When users click the provided link, they are redirected to a legitimate OAuth consent screen. The screen displays the grants the malicious attacker’s app will utilize. If the user approves, the attacker gains persistent access to the permissions they agreed to.
OAuth application consent grant attacks are primarily a threat in Entra ID and Google Workspace environments because these platforms rely heavily on OAuth for third-party integrations and user productivity tools. Both environments allow users to grant applications access to email, files, contacts, and other sensitive data through OAuth consent.
Read our case studies on what OAuth application consent grant attacks look like on Entra ID and Google Workspace
Preventing token theft largely relies on minimizing social engineering risk, which in turn relies on user awareness programs designed to educate users about the dangers of phishing, AitM tradecraft, and more.
Other technical controls to consider:
automountServiceAccountToken: false for pods not needing service account tokens.Remediating these threats changes upon how access tokens were stolen. In the case of an AitM attack or credential stealer malware, revoke active sessions and change the user’s password.
In the case of an OAuth application consent grant attack, then you need to identify and remove the malicious OAuth application, revoke active sessions, and change the password for all users the OAuth app was delegated to.
Tracking follow-on activity for stolen access tokens is highly dependent on the platform of origin.
For SaaS application suites such as Office 365 and Google Workspace, it is important to look for signs of business email compromise. These signs will surface as things such as malicious inbox rules, internal phishing campaigns, and persistence through the enrollment of MFA devices.
For cloud platforms, it is important to quickly identify what the adversary was able to access with the access token, as the adversary may use it to achieve long-term persistence, elevate their privileges, or exfiltrate data.
Adversaries may also leverage stolen tokens to create new accounts, modify existing permissions, or deploy additional malicious applications to further entrench themselves. In some cases, adversaries use these tokens to bypass security controls, disable logging, or to tamper with audit trails to evade detection. Monitoring for unusual administrative actions, privilege escalations, and unexpected changes to security configurations is critical for early detection and response.
Note: The visibility sections in this report are mapped to MITRE ATT&CK data components.
These data components will house important information about the cloud services that an adversary may try to access or manipulate after compromising after stealing an access token.
These data components will house important information about the cloud storage that an adversary may try to access or manipulate after compromising after stealing an access token.
These data components will record logs related to the creation or starting of containers.
Since adversaries will primarily attempt to steal credentials from users via phishing web pages or by using stealer malware that targets information stored in a browser, it may be helpful to have visibility into web credential usage.
Note: The collection sections of this report showcase specific log sources that you can use to collect relevant security information.
In order to detect an adversary abusing a stolen token, security teams must be able to compare metadata from the legitimate authentication that generated the token to similar metadata as the token is being used. You’re looking for deviations, like if the initial login came from an expected ISP but then the token is granting access from an unusual one. The following pseudo-detector is one example of how a security team might detect stolen token use.
action = authentication
where isp = ubiquitous_isp
THEN within 1 minute
action = any_non_authentication_action
where isp = anomalous_isp
and user = same_user_as_aboveStart testing your defenses against Steal Application Access Token using Atomic Red Team—an open source testing framework of small, highly portable detection tests mapped to MITRE ATT&CK.
The following atomics offer a great starting point for testing your defenses against adversaries who may steal application access tokens:
Now that you have executed one or several common tests and checked for the expected results, it’s useful to answer some immediate questions:
Repeat this process, performing additional tests related to this technique. You can also create and contribute tests of your own.