Skip to content

T1550.001 Application Access Token

Adversaries may use stolen application access tokens to bypass the typical authentication process and access restricted accounts, information, or services on remote systems. These tokens are typically stolen from users or services and used in lieu of login credentials.

Application access tokens are used to make authorized API requests on behalf of a user or service and are commonly used to access resources in cloud, container-based applications, and software-as-a-service (SaaS).2

OAuth is one commonly implemented framework that issues tokens to users for access to systems. These frameworks are used collaboratively to verify the user and determine what actions the user is allowed to perform. Once identity is established, the token allows actions to be authorized, without passing the actual credentials of the user. Therefore, compromise of the token can grant the adversary access to resources of other sites through a malicious application.8

For example, with a cloud-based email service, once an OAuth access token is granted to a malicious application, it can potentially gain long-term access to features of the user account if a “refresh” token enabling background access is awarded.5 With an OAuth access token an adversary can use the user-granted REST API to perform functions such as email searching and contact enumeration.10

Compromised access tokens may be used as an initial step in compromising other services. For example, if a token grants access to a victim’s primary email, the adversary may be able to extend access to all other services which the target subscribes by triggering forgotten password routines. In AWS and GCP environments, adversaries can trigger a request for a short-lived access token with the privileges of another user account.64 The adversary can then use this token to request data or perform actions the original account could not. If permissions for this feature are misconfigured – for example, by allowing all users to request a token for a particular account - an adversary may be able to gain initial access to a Cloud Account or escalate their privileges.9

Direct API access through a token negates the effectiveness of a second authentication factor and may be immune to intuitive countermeasures like changing passwords. For example, in AWS environments, an adversary who compromises a user’s AWS API credentials may be able to use the sts:GetFederationToken API call to create a federated user session, which will have the same permissions as the original user but may persist even if the original user credentials are deactivated.1 Additionally, access abuse over an API channel can be difficult to detect even from the service provider end, as the access can still align well with a legitimate workflow.

Item Value
ID T1550.001
Sub-techniques T1550.001, T1550.002, T1550.003, T1550.004
Tactics TA0005, TA0008
Platforms Azure AD, Containers, Google Workspace, IaaS, Office 365, SaaS
Version 1.5
Created 30 January 2020
Last Modified 04 May 2023

Procedure Examples

ID Name Description
G0007 APT28 APT28 has used several malicious applications that abused OAuth access tokens to gain access to target email accounts, including Gmail and Yahoo Mail.14
S1023 CreepyDrive CreepyDrive can use legitimate OAuth refresh tokens to authenticate with OneDrive.13
S0683 Peirates Peirates can use stolen service account tokens to perform its operations. It also enables adversaries to switch between valid service accounts.12
C0024 SolarWinds Compromise During the SolarWinds Compromise, APT29 used compromised service principals to make changes to the Office 365 environment.15

Mitigations

ID Mitigation Description
M1047 Audit Administrators should audit all cloud and container accounts to ensure that they are necessary and that the permissions granted to them are appropriate. Where possible, the ability to request temporary account tokens on behalf of another accounts should be disabled. Additionally, administrators can leverage audit tools to monitor actions that can be conducted as a result of OAuth 2.0 access. For instance, audit reports enable admins to identify privilege escalation actions such as role creations or policy modifications, which could be actions performed after initial access.
M1041 Encrypt Sensitive Information File encryption should be enforced across email communications containing sensitive information that may be obtained through access to email services.
M1021 Restrict Web-Based Content Update corporate policies to restrict what types of third-party applications may be added to any online service or tool that is linked to the company’s information, accounts or network (e.g., Google, Microsoft, Dropbox, Basecamp, GitHub). However, rather than providing high-level guidance on this, be extremely specific—include a list of per-approved applications and deny all others not on the list. Administrators may also block end-user consent through administrative portals, such as the Azure Portal, disabling users from authorizing third-party apps through OAuth and forcing administrative consent.11

Detection

ID Data Source Data Component
DS0006 Web Credential Web Credential Usage

References


  1. Vaishnav Murthy and Joel Eng. (2023, January 30). How Adversaries Can Persist with AWS User Federation. Retrieved March 10, 2023. 

  2. Auth0. (n.d.). Why You Should Always Use Access Tokens to Secure APIs. Retrieved September 12, 2019. 

  3. AWS. (n.d.). Logging IAM and AWS STS API calls with AWS CloudTrail. Retrieved April 1, 2022. 

  4. AWS. (n.d.). Requesting temporary security credentials. Retrieved April 1, 2022. 

  5. Cai, S., Flores, J., de Guzman, C., et. al.. (2019, August 27). Microsoft identity platform access tokens. Retrieved October 4, 2019. 

  6. Google Cloud. (2022, March 31). Creating short-lived service account credentials. Retrieved April 1, 2022. 

  7. Google Cloud. (2022, March 31). Monitor usage patterns for service accounts and keys . Retrieved April 1, 2022. 

  8. okta. (n.d.). What Happens If Your JWT Is Stolen?. Retrieved September 12, 2019. 

  9. Spencer Gietzen. (2018, August 8). Assume the Worst: Enumerating AWS Roles through ‘AssumeRole’. Retrieved April 1, 2022. 

  10. Stalmans, E.. (2017, August 2). Phishing with OAuth and o365/Azure. Retrieved October 4, 2019. 

  11. InGuardians. (2022, January 5). Peirates GitHub. Retrieved February 8, 2022. 

  12. Microsoft. (2022, June 2). Exposing POLONIUM activity and infrastructure targeting Israeli organizations. Retrieved July 1, 2022. 

  13. Hacquebord, F.. (2017, April 25). Pawn Storm Abuses Open Authentication in Advanced Social Engineering Attacks. Retrieved October 4, 2019. 

  14. CrowdStrike. (2022, January 27). Early Bird Catches the Wormhole: Observations from the StellarParticle Campaign. Retrieved February 7, 2022. 

  15. Dror Alon. (2022, December 8). Compromised Cloud Compute Credentials: Case Studies From the Wild. Retrieved March 9, 2023.