Join our Newsletter — 33% off our NHI Course
Home› Guides› How to investigate a compromised Slack token: identify,…
Guide Incident Response & Forensics

How to investigate a compromised Slack token: identify, trace, contain and recover

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 17 min read
On this page

A leaked Slack token is a bearer credential: whoever holds it can call the Slack Web API as the bot, user or app it belongs to until someone revokes it. Tokens turn up in public repositories, CI logs, pasted support tickets, browser extensions and the systems of integration vendors, and the first signal is often a secret scanner alert or a Slack anomaly event rather than anything a person notices. This guide is an ordered runbook for one suspected token: identify exactly what it is, decide which logs can answer your questions on your plan, reconstruct what it did, then contain and recover without destroying the evidence. It is written for security operations staff and Slack administrators. It does not repeat the token hardening material in the Slack Tokens Security Guide or the detection rules in the Slack Audit Logs Detection Guide; read those for prevention and alerting.

Key takeaways

  • Identify the token before you revoke it. The prefix, plus one auth.test call, tells you whether it acts as a bot, a user or an app, and which workspace and user ID to search for in the logs.
  • Your plan decides your evidence. Access logs and integration logs exist on paid plans; the Audit Logs API, with app context and anomaly events, exists only on Enterprise plans. Know which you have before the incident.
  • Scope is the blast radius. The granted scopes and the channels the bot or user can see define what could have been read, so record them from the integration logs and app configuration before anything changes.
  • Revocation is not one action. auth.revoke kills a single token, apps.uninstall kills every token for an installation, and user sessions, signing secrets, client secrets and webhook URLs are separate credentials.
  • Finish at the source. A revoked token that is still in a repository, pipeline or vendor system will be replaced by its owner with a new one in the same unsafe place unless you fix where it leaked from.

Step 1: identify the token and preserve the evidence

Treat the token string itself as evidence. Record where it was found, the time it was found, and who has seen it, then store it in your case management or secrets tool, not in a chat thread. Slack token strings carry a prefix that tells you the identity type before you call any API.

PrefixToken typeActs asLifetime (per Slack docs)Investigation focus
xoxb-Bot tokenThe app's bot user, independent of any personStays valid until revoked unless the app uses token rotationApp ID, bot scopes, channels the bot is a member of
xoxp-User tokenA workspace member, with that person's accessStays valid until revoked unless the app uses token rotationThe member's user ID, their channels and DMs, the app that issued it
xapp-App-level tokenThe app across organisations, for app-level APIs such as Socket ModeDoes not expire by defaultSocket Mode connections, which app, who holds the app configuration
xoxe.xapp-Rotating app-level tokenAs above, with rotation enabledAccess tokens expire 12 hours after issue; refresh tokens are single useWhether the refresh token also leaked, which keeps access alive
xwfp-Workflow tokenA workflow step, without user scopesExpires 15 minutes after issue or when the step endsUsually low value once expired; find the workflow that logged it

Then confirm what the token is with one read-only call:

  1. Call auth.test from a controlled host, and note its IP. It needs no scopes and returns team_id, user_id, the workspace url, bot_id for bot tokens and enterprise_id for Enterprise organisations.
  2. Read the error if it fails. token_revoked or token_expired means the token is already dead, but you still need to investigate what it did while valid. account_inactive means a bot token for a deleted user or workspace.
  3. Map the bot or user to an app. For a bot token, find the app that owns the bot_id in the workspace's app management pages. For a user token, find which app the person authorised; one person may have authorised several apps, each with its own token.
  4. Snapshot the configuration. Export the app's current scopes, installing user, collaborators, redirect URLs and IP allowlist before anyone reinstalls or edits it. Reinstalls change the record you need.

Do not test the token further than auth.test. Calling content APIs with a leaked credential adds noise to the logs you are about to read and, on Enterprise plans, may itself raise anomaly events.

Step 2: know which logs your plan gives you

Slack offers three log sources that matter for a token investigation, and their availability depends on the plan.

SourcePlanAccessWhat it answersLimits to know
Access logs (team.accessLogs and the admin Access logs page)Paid plans; free workspaces get paid_onlyUser token with admin scope; workspace or org owners and admins in the UIWhich IP, user agent, ISP and approximate location accessed as a member, with first seen, last seen and countEntries are grouped by user, IP and user agent, so you see combinations, not individual calls. Up to 1,000 items per page and 100 pages per query
Integration logs (team.integrationLogs)Paid plansUser token with admin scopeWhen an app was added, removed, enabled, disabled, updated or had scopes expanded, by which user, with which scopesRecords changes to the integration, not API calls made with it
Audit Logs API (https://api.slack.com/audit/v1/logs)Enterprise plans onlyauditlogs:read user token from an app installed on the organisation by the org ownerApp installs and scope changes, file downloads, exports, sessions, logins and anomaly events, with IP, user agent and session ID in contextRecords actions, not message content. Filter with oldest, latest, action (up to 30), actor and entity

On a Pro or Business+ workspace you are working mainly from access and integration logs, plus your own records: the logs of the system the token was used by, egress logs, and any request logs your app keeps. On Enterprise, the Audit Logs API is the primary source, and Slack's access logs help documentation notes that some third-party app actions do not appear in workspace-level access logs, so query the org-level API rather than one workspace page. The Slack Enterprise Security Guide covers setting the Audit Logs API up before you need it.

Step 3: establish the exposure window

Every later query needs a start and end time. Work out three timestamps and write them in the case record:

  • Earliest possible exposure: the commit time, log write time, ticket creation time or vendor breach date where the token first appeared outside its intended store. For a public repository, use the earliest commit containing the string, not the date the scanner noticed it.
  • Token issue time: for user and bot tokens, the most recent install or reinstall of the app, from the integration logs or app_installed audit events. A token cannot have been used before it existed, which can shorten the window considerably.
  • Revocation time: when you revoke (Step 6), or when auth.test first returned token_revoked.

If the token uses rotation, a stolen access token is only valid for 12 hours, but a stolen refresh token lets the holder mint new access tokens. Find out which was exposed: a leaked refresh token makes the window run from exposure to revocation, as with a non-rotating token.

Step 4: reconstruct what the token did

Pivot between sources using the identifiers from Step 1: the user ID or bot user ID, the app ID, and the IPs you have ruled out as your own. Work through these questions in order.

Where was it used from?

  • User tokens on paid plans: pull team.accessLogs for the exposure window (set before to the revocation time and page back). Slack's help documentation states that entries are created when a member performs actions through an app or bot acting on their behalf, so user token use appears here. Look for IP, ISP or user agent combinations whose date_first falls inside the window and which do not match the app's known hosting.
  • All token types on Enterprise: query the Audit Logs API with actor set to the user or bot user ID and read context.ip_address, context.ua and context.session_id. Events triggered by an app carry an app object with its ID, name, scopes and scopes_bot, which lets you separate this app's actions from the person's own.
  • Your own side: if you control the app, compare its outbound request logs with Slack's records. Calls that Slack logged and your app did not make came from the attacker.

Did Slack flag it?

On Enterprise plans, query for action=anomaly across the window. Slack's anomalous events reference lists the reasons, and several apply to app entities as well as users. Treat these as leads to confirm, not verdicts.

Anomaly reasonApplies toWhat it suggests for a token investigation
ip_address (details new-asn, cloud-asn, in-ioc-list)App, userToken used from a network outside its history; a cloud ASN is common for scripted reuse
asn, torApp, userSource on a suspicious ASN list or a Tor exit node
unexpected_credential_testingAppSomeone checked whether the credential works, often the first step after a leak
excessive_downloads, excessive_file_sharesApp, userBulk file collection or files shared outward
unexpected_scraping, unexpected_api_call_volumeUserScripted bulk reading with a user token
user_agent, unexpected_client, session_fingerprintUserClient characteristics changed, consistent with a token replayed from a different tool

What could it read, and what did it touch?

  • Possible reach: list the scopes from the integration log entry (scope field) or the audit app object. History scopes such as channels:history and groups:history mean message content was readable; see the Slack History Scopes guide for what each grants. A bot token reads only conversations the bot is a member of; a user token reads everything that member can see, including their DMs where the scopes allow.
  • Files: search file_downloaded events with the actor and the window. Each event names the file entity, which gives you a concrete list for data owners.
  • Bulk exports: check manual_export_started, scheduled_export_started, channels_export_started and the matching _downloaded events. These are admin actions, so they matter most when the token belonged to an admin.
  • Message reads: the Audit Logs API does not record message content or individual history reads. If your evidence shows the token was used and it held history scopes, scope the impact as every conversation it could read during the window, and say so in the report.

Did it create persistence?

  • New or changed apps: app_installed, app_approved, app_scopes_expanded, app_manifest_updated and app_collaborator_added during the window, especially by the compromised user.
  • Preserved tokens: app_token_preserved means a token was kept rather than revoked during a change; confirm it was intended.
  • Integration log changes: change_type of added, expanded or enabled on any app or service by the affected user.
  • Admin token cases: if the token belonged to an admin, review changes to app approval rules (app_allowlist_rule_created, app_allowlist_rule_updated), user roles and guest creation in the same window.

Step 5: decide how serious it is

Use what you found to choose the response level.

FindingSeverity guideResponse
Token exposed, no use outside known infrastructure, narrow scopes (for example chat:write only)LowRevoke, reissue, fix the leak source, record the review
Token used from unknown IPs, no history or file scopesMediumRevoke, check for spam or phishing messages posted as the bot, warn channel members
Unknown use with history, file or search scopesHighFull containment, data owner notification, assess personal data in readable channels
User token of an admin or owner, or persistence foundCriticalTreat as a workspace compromise; use the Collaboration Workspace Compromise Playbook

A bot that can post messages is also a phishing channel inside the workspace: messages from a familiar integration carry trust. If the token held chat:write and was used, search the bot's posts in the window and tell recipients which messages to disregard. The Teams and Slack Phishing vs Email Phishing guide explains why these lures work.

Step 6: contain in the right order

Containment should remove the attacker's access without removing your evidence or breaking more than necessary. Pull the logs from Step 4 first, then:

  1. Revoke the token. Call auth.revoke with the leaked token. You can run it with test=1 first to confirm the call is well formed. Slack's documentation states that revoking a bot token deactivates the bot user and removes its channel memberships but does not uninstall the app.
  2. Revoke the whole installation where needed. If more than one token from the same installation may be exposed, or you do not trust the app's token store, apps.uninstall (which needs the app's client ID and client secret) revokes all tokens for that installation. For org-wide apps on Enterprise, an org admin removes the app in the admin console.
  3. Reset the user's sessions for user tokens. On Enterprise plans, admin.users.session.reset (scope admin.users:write) ends the member's sessions on every device. Revoke the user's authorisations of the affected app as well; a session reset and a token revocation are different controls.
  4. Rotate the app's other secrets if its configuration was exposed. If the leak came from the app's own environment, assume the client secret, signing secret, refresh tokens and any incoming webhook URLs in the same store were exposed too. Webhook URLs are separate credentials that token revocation does not touch.
  5. Restrict where new tokens can be used. Slack lets you limit an app's OAuth tokens to an allowlist of up to 20 IP addresses or ranges (IPv4 only; not applied to incoming webhooks). Add it when you reissue, so a future leak of the same token type is less useful outside your hosting.
  6. Verify, and hold the reissue. Do not reissue until Step 7 is done. Run auth.test with the old token and confirm token_revoked. Watch the audit log for further events from the old token's IPs for at least the following days.

Step 7: recover and close the source

  • Remove the token from where it leaked: delete it from the file, log, ticket or message, and rewrite repository history where it was committed. The guide on finding secrets in Slack and Teams messages covers sweeping Slack itself.
  • Purge copies: Slack's security guidance says that a token you no longer need should be deleted immediately from all production systems and backups.
  • Reissue into a secrets manager: store the new token in a managed secret store and inject it at runtime, never in code or CI variables visible to every job.
  • Reduce scope on reissue: request only the scopes the app uses today. Scopes are additive across reinstalls, so a reissue is the cleanest moment to drop old ones.
  • Turn on token rotation for apps you build: Slack's docs note that rotation cannot be turned off once enabled, so test it in a development app first.
  • Third-party apps: if the vendor's environment leaked the token, ask the vendor for their incident timeline and the IPs their service uses, and compare them with your Step 4 findings. The Slack GitHub breach shows the pattern in reverse: employee tokens held by a vendor were stolen from that vendor and used against Slack's own code repositories.

Where identity fits

Every Slack token is a non-human identity with an owner, a scope set and a lifetime, and most leaked-token incidents trace back to one of those three being unmanaged. After the incident, make sure the app is in your inventory with a named owner and a recorded scope justification. The audit of Slack apps, bots and tokens is the routine that finds the next over-scoped or ownerless token before it leaks.

Detection and measurement

  • Time from exposure to revocation: measured from earliest exposure (Step 3) to confirmed token_revoked. This is the number that best reflects real risk.
  • Time from alert to revocation: the part your team controls; aim to cut it by having the runbook, admin tokens and app owners known in advance.
  • Share of Slack apps with rotation or an IP allowlist: tracks how much a future leak would be worth to an attacker.
  • Repeat leaks per app: a second leak from the same app means Step 7 did not fix the source.
  • Audit log coverage: on Enterprise, alert when the audit log collector stops receiving events; an investigation with a gap in the window cannot rule out use.

Framework mapping

FrameworkReferenceHow it applies
MITRE ATT&CKT1528 Steal Application Access TokenHow the token is obtained, for example from a vendor or code store
MITRE ATT&CKT1550.001 Application Access TokenReuse of the stolen token against the Slack API
MITRE ATT&CKT1213.005 Messaging ApplicationsCollection of messages and files from Slack
MITRE ATT&CKT1552.001 Credentials In FilesTokens left in repositories, configuration files and logs
NIST CSF 2.0DE.AE-02, RS.AN-03, RS.MI-01Analysing the events, establishing what happened, containing the incident
NIST SP 800-53 Rev 5IR-4, AU-6, IA-5Incident handling, audit record review, authenticator management (revocation and reissue)

Common failure patterns

  • Revoking before pulling logs: the reinstall that follows a revocation changes the app record, and teams lose the scope and installer details they needed. Snapshot first.
  • Assuming a session reset kills API tokens: resetting a member's sessions and revoking the tokens their authorised apps hold are separate actions. Do both for user token cases.
  • Revoking one token of several: a single installation can hold bot, user and refresh tokens. If the store leaked, revoke the installation, not just the string you were sent.
  • Ignoring webhooks and secrets: incoming webhook URLs and the signing secret often sit beside the token in the same file and are untouched by token revocation.
  • Calling it contained without the source fixed: the owner reissues, pastes the new token into the same pipeline variable, and the cycle repeats.
  • No Enterprise audit data and no app logs: on paid plans without the Audit Logs API, an app that keeps no request logs leaves you unable to tell attacker calls from normal ones, which pushes impact to the worst case.

Practitioner checklist

  • Record where and when the token was found, and store it as evidence in a secure case record.
  • Identify the type from the prefix and confirm it with one auth.test call from a known IP.
  • Snapshot the app's scopes, installer, collaborators and allowlist before any change.
  • Confirm which logs your plan provides and pull them for the full exposure window.
  • Check anomaly events, file downloads, exports and app changes for the actor and app ID.
  • Rate severity from scopes and confirmed use; escalate admin token cases to a workspace compromise.
  • Revoke the token, or uninstall the installation where more than one token may be exposed.
  • Reset user sessions and rotate client secret, signing secret and webhooks where the store leaked.
  • Remove the token from its leak source and backups, and reissue with fewer scopes into a secrets manager.
  • Add an IP allowlist or rotation on reissue, and record exposure-to-revocation time.

Standards and references

Related NHI Mgmt Group resources: Slack Tokens Security Guide · Slack Audit Logs Detection Guide · How to audit Slack apps, bots and tokens · How to investigate a compromised GitHub account

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.