Skip to content

Get notified

Get an email when a new major security incident drops. No spam, unsubscribe any time.

Only used for pwn.watch incident emails. Protected by Cloudflare Turnstile.

Triage & Response10 min read

SSO & OAuth Token Theft Incident Response Playbook

What to do when SSO sessions, OAuth refresh tokens, or third-party integration tokens are stolen: invalidate sessions, revoke refresh tokens, rotate signing secrets, audit connected OAuth apps, and harden your identity provider, with lessons from GitBook, Bubble, Cloudflare, Okta and Better Auth incidents.

// key takeaways

  • Token theft bypasses MFA. Whether the token came from a SSO flaw, a support upload, an infostealer or a breached vendor, the response is the same: revoke sessions and refresh tokens, then rotate whatever signs them.
  • Incomplete rotation is the most common failure. Cloudflare's Thanksgiving 2023 intrusion used one access token and three service account credentials from the Okta breach that had not been rotated.
  • Every third-party integration holding your OAuth tokens or API keys is part of your attack surface. GitBook, Bubble and Salesloft Drift customers all had to act on tokens stored by someone else.
  • If a library signs sessions or verification links with one application secret, a signing flaw makes old signatures dangerous. Better Auth told users to rotate that secret after upgrading because signatures issued before the fix stay valid until it changes.
  • Directory data is sensitive even without passwords. The Icepick leak exposed names, phone numbers and permission groups for more than 41,000 DHS employees, which is ideal material for targeted phishing.

How SSO and OAuth tokens actually get stolen

In the 2023 Okta support system breach, an attacker used a stolen service account to download files that customers had uploaded to Okta support. Some were HAR files containing live session tokens, which were used to hijack the Okta sessions of five customers, including BeyondTrust, Cloudflare and 1Password. No password or MFA prompt was involved. Weeks later, Cloudflare found a suspected nation-state attacker inside its Atlassian Confluence, Jira and Bitbucket, using one access token and three service account credentials from that breach that Cloudflare had failed to rotate. Reconnaissance began on November 14, 2023 and Cloudflare detected the attacker on November 23.

Vendors that hold your tokens are the other path. Between August 8 and 18, 2025, the actor Google tracks as UNC6395 used stolen OAuth tokens for the Salesloft Drift chatbot integration to bulk-export data from customers' Salesforce instances, hunting for AWS keys, Snowflake tokens and passwords. On October 26, 2026, Bubble confirmed an attacker had accessed third-party tokens and credentials, such as API keys used in its API Connector and plugins, belonging to a subset of its users.

Sometimes the identity layer itself fails. On November 2, 2026, an attacker used a flaw in GitBook's SSO login flow to create sessions as GitBook staff, pulled credentials for a misconfigured internal GitHub App, and reached production secrets with full infrastructure access. GitBook took its app offline for about 16 hours, invalidated all API tokens and treated all customer data as exposed, including integration tokens, session signing secrets and the ability to act as its GitHub and GitLab apps in customer repositories.

Step 1: invalidate sessions everywhere

Start at the identity provider, because one IdP session can mint new sessions in every downstream app. Clear the affected users' IdP sessions and the OAuth tokens issued through them, then force reauthentication with phishing-resistant MFA. For service accounts, disable the account before rotating its credentials so the attacker cannot use the window between the two steps.

IdP logout does not end sessions that downstream apps already issued. Many apps keep their own session cookies for hours or days. For each critical app, use its admin API to revoke sessions, or rotate the session signing secret, which logs everyone out at once. GitBook's customer guidance after its breach included regenerating authenticated-access signing keys and re-authenticating its MCP server, because sessions and tokens signed with old keys were considered exposed.

  • Clear IdP sessions and IdP-issued OAuth tokens for every affected user and service account.
  • Revoke app-level sessions in source control, cloud consoles, chat, ticketing and CI, not only at the IdP.
  • Rotate session signing secrets for apps you run when the secret itself may be exposed, accepting a global logout.
  • Require fresh phishing-resistant MFA (security keys or passkeys) on the next sign-in for affected accounts.
  • Record the revocation time; any use of an old token after it is a high-confidence detection.
Revoke IdP sessions and tokens for a user
# Okta: clear all sessions and OAuth tokens issued to a user
curl -sS -X DELETE \
  -H "Authorization: SSWS $OKTA_API_TOKEN" \
  "https://$OKTA_DOMAIN/api/v1/users/$USER_ID/sessions?oauthTokens=true"

# Microsoft Entra ID (Graph PowerShell): invalidate refresh tokens and sessions
Revoke-MgUserSignInSession -UserId $UserId

Step 2: revoke refresh tokens and rotate signing secrets

Access tokens expire on their own; refresh tokens and API keys usually do not. A stolen refresh token keeps minting access tokens until the issuer revokes it, which is why Salesloft and Salesforce revoked Drift's access and refresh tokens during that incident. List every long-lived token tied to the affected users, apps and integrations, revoke them at the issuer, and issue new ones only after the source of the leak is closed.

Signing secrets need the same treatment. In November 2026, Better Auth disclosed that its expo() server plugin signed a caller-supplied state value with the application secret. Because the same secret signed email verification links and the session cookie cache, an unauthenticated attacker could take over accounts. The fix shipped in 1.7.16 and 1.8.0-beta.5, and Better Auth told users to rotate the application secret after upgrading, because signatures issued before the fix stay valid until the secret changes. Patching code without rotating secrets leaves forged sessions alive.

  • Revoke refresh tokens and offline-access grants at the issuer, not only in your app database.
  • Rotate application secrets, JWT signing keys and cookie signing keys that the incident may have exposed, and drop old keys from verification sets.
  • Rotate API keys stored in integrations (API connectors, plugins, webhooks) and set spend or rate limits where providers support them.
  • Disable, then rotate, service account credentials; confirm the old credential fails before closing the task.
  • Track rotation to 100% completion with an owner per credential. Cloudflare's 2023 intrusion came through four credentials that were missed.

Step 3: audit third-party OAuth apps and integrations

Every app a user or admin approved holds a grant into your data, and many request offline access. After a vendor breach you need to know, within an hour, which vendors hold tokens for which systems, what scopes they have and who approved them. The GitBook incident is a good example of the scope: GitBook could act as its GitHub and GitLab apps in repositories customers had granted, so customers had to review connected repositories as well as rotate tokens.

Use the audit to cut standing access. Remove apps nobody uses, narrow scopes, and move integrations from personal user grants to dedicated service identities that can be revoked without locking out a person. GhostAction's 2026 phishing kit is a reminder of how grants get created: it stole a GitHub password and 2FA code, then silently authorized an OAuth app with repo and workflow scopes.

  • Export all OAuth grants and app installations from your IdP, Google Workspace or Microsoft 365, GitHub, GitLab, Slack and Salesforce.
  • Flag grants with offline access, write scopes, or admin consent, and any app approved by a single user for an org-wide resource.
  • Revoke grants for the breached vendor first, then for unused or over-scoped apps.
  • Require admin approval for new OAuth apps and restrict which scopes users can grant on their own.
  • Review audit logs for the vendor's app identity and the vendor's published indicators, such as the three attacker IP addresses GitBook published.
List and revoke SSO-authorized credentials in a GitHub org
# GitHub Enterprise Cloud orgs with SAML SSO: list PATs, SSH keys and OAuth tokens authorized for the org
gh api "orgs/$ORG/credential-authorizations" --paginate \
  -q '.[] | [.login, .credential_type, .credential_id, .credential_authorized_at, (.scopes|join(","))] | @tsv'

# Revoke one credential's access to the org
gh api -X DELETE "orgs/$ORG/credential-authorizations/$CREDENTIAL_ID"

Step 4: harden the identity provider

Most of these incidents had a hardening lesson that applies before anything is stolen. The Okta support breach turned HAR files into session tokens, so sanitize HAR files before sharing them with any vendor. CircleCI's 2023 breach began with malware stealing a 2FA-backed SSO session from an engineer's laptop, so bind sessions to devices and keep session lifetimes short for privileged roles.

Treat the directory itself as sensitive data. The Icepick archive published on October 28, 2026 covered more than 41,000 DHS employees and contractors, with contact details, supervisors and over 55,000 permission-group names. Distributed Denial of Secrets said it came from DHS's Okta login system; Okta said it had no evidence its systems were compromised. Whatever the route, review which users and apps can read your directory and audit bulk exports.

  • Enforce phishing-resistant MFA for admins and for anyone who can approve OAuth apps or change IdP policy.
  • Bind sessions to managed devices, shorten admin session lifetimes, and require re-authentication for sensitive actions.
  • Restrict who can create API tokens and service accounts, and inventory them with owners and expiry dates.
  • Sanitize HAR files and browser traces before uploading them to support portals.
  • Limit directory read access for apps and users, and alert on bulk directory exports.
  • Monitor for impossible travel, new device sign-ins with an existing session, and token use from unexpected ASNs.

// actionable engineering checklist

  • Clear IdP sessions and tokens

    Revoke all sessions and IdP-issued OAuth tokens for affected users and service accounts, then force phishing-resistant MFA.

  • Revoke downstream app sessions

    Use each critical app's admin API or rotate its session signing secret; IdP logout alone does not end existing app sessions.

  • Revoke refresh tokens and API keys

    Revoke at the issuer, including integration and plugin keys, and confirm old tokens fail.

  • Rotate signing secrets after auth fixes

    After patching an auth library flaw, rotate the application and cookie signing secrets so pre-fix signatures stop working.

  • Audit connected OAuth apps

    Export grants from every major SaaS, revoke the breached vendor and unused apps, and require admin approval for new ones.

  • Finish the rotation

    Track every exposed credential to confirmed rotation with an owner, so nothing is left like the four credentials behind Cloudflare's 2023 intrusion.

  • Harden the IdP

    Device-bound sessions, short admin session lifetimes, restricted token creation, sanitized HAR files and directory read limits.

// connected pwn.watch tools & live trackers

Frequently Asked Questions

Does MFA protect against stolen session tokens?
No. MFA protects the sign-in, and a session token or refresh token is what you get after signing in. That is how HAR files from the Okta support breach were used to hijack customers' sessions. Revoke sessions and tokens, and bind sessions to managed devices to limit replay.
Is logging users out of the IdP enough?
Usually not. Downstream apps issue their own sessions and refresh tokens that survive IdP logout. Revoke sessions in each critical app, revoke refresh tokens at the issuer, and rotate signing secrets if they may be exposed.
Why rotate secrets after patching an auth library?
If the flaw let attackers obtain valid signatures, those signatures stay valid after the patch. Better Auth's advisory for its Expo plugin said exactly this: upgrade, then rotate the application secret.
What should I do when a vendor that holds my OAuth tokens is breached?
Revoke the vendor's grants and any API keys you gave it, review audit logs for its app identity and published indicators, reissue credentials only after the vendor confirms containment, and record which data the grant could reach.

Get an email when a new major security incident drops. No spam, unsubscribe any time.