← Learn
Playbook8 min read

OAuth connected-app token compromise — the SaaS breach response playbook

Published by Zero Hunt, an autonomous AI red team on an on-premise appliance running private AI: automated penetration testing for networks and infrastructure, black-box or gray-box, with a human approving every step that matters.

Short definition

An operational playbook for when a connected third-party app’s OAuth token is abused to pull your SaaS data over the API — bypassing MFA. Revocation order, API-egress scoping, evidence list.

Why this matters now

The 2025 Salesloft Drift campaign (UNC6395) exported data from hundreds of Salesforce tenants using stolen OAuth tokens — no password, no phishing, no MFA prompt, just a valid machine grant with API scope. When the token is the credential your sign-in logs look clean, and the only record of the theft is in API audit trails. This playbook is the runbook for identifying the abused app, revoking its grant, and scoping exactly what left.

Key points

  • ▸A stolen OAuth token authenticates as the app, not a user — MFA, conditional access and password resets do nothing to stop it.
  • ▸The clock starts at the first credible report that the connected app was breached, not when you confirm your own tenant was touched.
  • ▸Revoke the grant, not just the session: kill the connected app’s refresh and access tokens, then remove the integration — a session reset leaves the refresh token live.
  • ▸Scope the pull from API audit logs (Salesforce Event Monitoring and friends), not sign-in logs — the attacker never signed in.
  • ▸Rotate everything the exported data could contain: AWS keys, Snowflake tokens, passwords — UNC6395 grepped exports for exactly these.
  • ▸If customer or personal data was pulled, NIS2 Article 23 and GDPR Art. 33 fire on the same evidence base.

When this playbook fires

Use this playbook when any of the following is true:

  • A third-party vendor whose app you have connected to a SaaS platform (Salesforce, Google Workspace, Microsoft 365, Slack, GitHub, a CRM or data integration) discloses a breach, and that app holds an OAuth grant with API or read scope into your tenant.
  • Your SaaS provider notifies you that data was accessed through a connected or third-party application rather than through a user login — the Salesloft Drift / UNC6395 campaign is the archetype.
  • You see bulk API reads from a connected app in your SaaS audit log that do not line up with that integration’s normal job schedule.
  • An OAuth token you issued to an integration turns up in a stealer log or paste dump.

Do NOT use this playbook for: a user account takeover where the attacker logged in as a person (use your identity-compromise runbook — see Identity provider compromise), phishing of a human credential, or a classic CVE in software you host. The defining marker here is that no human logged in — a machine grant did the work, so MFA and password resets are irrelevant and your sign-in logs look normal.

Hour 0 — token compromise or account takeover?

The first decision decides everything downstream: did an attacker log in as a person, or use a token issued to an app? Get this wrong and you spend the incident resetting passwords while the grant keeps pulling data.

Signals that this is a connected-app token compromise, not an account takeover:

  • The data access shows up in API / connected-app audit events, not in interactive sign-in logs. In Salesforce this is Event Monitoring and the connected app’s authentication history; in Microsoft 365 and Google Workspace it is the OAuth-app audit log, not the user sign-in log.
  • There is no failed-MFA, no new-device, no impossible-travel signal on any user account — because no user authenticated.
  • The source of the queries is the app’s identity (a service principal or connected-app client ID), often from infrastructure (hosting, VPS, Tor) unrelated to any employee. UNC6395 queried from Tor and used custom User-Agent strings such as Salesforce-Multi-Org-Fetcher/1.0.
  • The volume and shape are machine-like: large, paginated, sequential queries pulling whole objects, not a human clicking around.

Write the awareness timestamp down the moment you reach this conclusion — if personal data is involved the regulatory clock counts from awareness, and you want the date to survive a later read of your own logs.

Phase A — contain: revoke the grant

Containment for a token compromise is revoke the grant, and it is not the same as ending a session. A signed-out session re-authenticates from a still-valid refresh token; you have to kill the token and the app.

First action window — do these in order:

  1. Revoke the connected app’s active access and refresh tokens. In the Salesloft Drift incident, Salesloft and Salesforce revoked all active access and refresh tokens for the Drift app on 20 Aug 2025 — that, not password resets, is what stopped the pull.
  2. Remove or disable the integration so it cannot request a fresh token. In Microsoft Entra this means disabling user sign-in to the enterprise app or deleting it — see Microsoft’s methods for removing app access. In Salesforce, block the connected app or remove its OAuth policy.
  3. Block new consent so the same or a sibling app cannot be re-authorized mid-incident. Lock admin consent and review the user-consent policy.
  4. Preserve, do not delete. Export the connected app’s authentication and API-query history before you remove it — once the app record is gone, so is some of your evidence.

Do this for every tenant and every SaaS platform the breached vendor’s app touched, not just the one where you first saw it. A single vendor app is often authorized across several of your SaaS systems.

Phase B — scope the pull from API logs

You cannot notify accurately until you know what left. For a token compromise the answer is only in API-level logs, because nothing went through a login.

Intermediate window — reconstruct the pull:

  • Pull the connected app’s full API query history for the exposure window plus a margin before the vendor’s stated compromise start. In Salesforce, Event Monitoring records the queries — in the Drift case the attacker deleted the query jobs, but the event logs themselves remained.
  • Enumerate which objects and fields were read — accounts, contacts, cases, attachments, and any secrets sitting in free-text fields. UNC6395 specifically searched the exported data for AWS access keys (AKIA), passwords, and Snowflake tokens; assume any such secret in the pulled objects is now compromised.
  • Convert volume to records: paginated SELECT-style queries give you row counts. Turn that into a concrete count of data subjects or customers for the notification.
  • Cross-check against the vendor’s own advisory and any published indicators — the CISA cybersecurity advisories index and vendor security hubs such as Okta’s carry IOCs for the larger campaigns.

The output of this phase is a defensible statement of what data, how many records, which subjects — the input every downstream notification needs.

Phase C — rotate and notify

Closure has two tracks: rotate what the pull could have exposed, and file what the law requires.

Rotate, in priority order:

  1. Any secrets that were sitting in the pulled data — API keys, cloud access keys, database and Snowflake tokens, passwords pasted into notes or case fields. Treat them as public.
  2. The OAuth credentials of the integration itself (its client secret), if you rebuild the connection.
  3. Any downstream credentials the attacker could have reached using the secrets from step 1 — lateral reach is the real damage, and UNC6395’s stated goal was credential harvesting for follow-on access.

Notify, if personal or customer data was in the pulled objects:

  • NIS2 Article 23 — early warning (24h), notification (72h), final report (1 month) if you are an essential or important entity. The NIS2 Article 23 timeline playbook covers the cadence.
  • GDPR Art. 33 — 72 hours to the supervisory authority, on the same evidence base.
  • Your own downstream customers, where contract or law requires it. Remember the evidence (API logs) is partly held by your SaaS provider, so request their export early — the notification-duty playbook for a breached SaaS vendor covers that split-custody problem.

Evidence checklist

Have these ready, ordered by which gate consumes them first:

  • Connected-app authentication history — every token issuance and API session for the suspect app. Both the containment and scoping gates need it; export before you delete the app.
  • API query / event log for the exposure window — the record of what was actually read (Salesforce Event Monitoring, Microsoft 365 / Google OAuth-app audit logs).
  • The grant itself — the scopes the app held (read, API, offline_access / refresh), captured before revocation, so you can state exactly what it could reach.
  • Vendor advisory and IOC list — the third party’s own breach statement and any published indicators, tied to your observed activity.
  • Rotation log — every secret rotated, with timestamp and approver, for the final report.
  • Notification register — what you filed, to whom, when.

The recurring pain across peer organizations: this evidence lives half in your tenant and half in the SaaS provider’s, and the provider’s export has its own SLA. Request it in hour one, not on day three.

Common failure modes

Five anti-patterns that turn a contained token compromise back into an open one:

  • Resetting passwords and calling it contained. No one logged in; the refresh token does not care about the new password. Only revoking the grant stops it.
  • Revoking the session but not the token. A signed-out connected app silently re-authenticates from its refresh token. Kill the token, then the app.
  • Deleting the app before exporting its history. The connected app’s authentication and query log is your primary evidence; removing the app can take it with it. Export, then remove.
  • Scoping from sign-in logs. They are clean by definition and will make you under-report. Scope from API logs only.
  • Containing one tenant. A breached vendor app is usually authorized across several of your SaaS platforms, and attackers pivot to the next grant. Revoke everywhere the vendor’s app was consented.

Detection — catching the pull in progress

The best outcome is catching the pull while it runs, not reconstructing it after the vendor’s advisory. The signal is behavioral: a connected app that normally syncs a trickle suddenly issuing large, sequential, whole-object queries — a bulk read that does not match its job schedule.

Where that signal lives depends on topology. For pure SaaS-to-SaaS abuse — the attacker queries the provider’s cloud directly with a stolen token — the only record is the SaaS provider’s own API audit log, so route Event Monitoring and OAuth-app logs into your SIEM with alerts on per-app query volume and new source identities. For the very common hybrid case — a self-hosted connector, iPaaS middleware or on-prem agent that holds the token and moves the data through your own network — the anomalous bulk egress does cross your wire, and that is where Zero Hunt’s on-prem traffic-analysis engine earns its place: it watches the wire and flags the sustained, out-of-pattern outbound volume from an integration host as it happens, with nothing leaving the appliance. Pair that with proactively validating which of your connected apps hold over-scoped, reachable grants — shrinking the blast radius of the next stolen token before it is stolen — and the connected-app surface stops being a blind spot. See the exfiltration-detection use case for the behavioral-egress workflow.

Goes deeper

Want this against your environment?

Book a 30-minute scoping call — we will map this directly to your current compliance scope and threat profile.