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.testcall, 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.revokekills a single token,apps.uninstallkills 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.
| Prefix | Token type | Acts as | Lifetime (per Slack docs) | Investigation focus |
|---|---|---|---|---|
xoxb- | Bot token | The app's bot user, independent of any person | Stays valid until revoked unless the app uses token rotation | App ID, bot scopes, channels the bot is a member of |
xoxp- | User token | A workspace member, with that person's access | Stays valid until revoked unless the app uses token rotation | The member's user ID, their channels and DMs, the app that issued it |
xapp- | App-level token | The app across organisations, for app-level APIs such as Socket Mode | Does not expire by default | Socket Mode connections, which app, who holds the app configuration |
xoxe.xapp- | Rotating app-level token | As above, with rotation enabled | Access tokens expire 12 hours after issue; refresh tokens are single use | Whether the refresh token also leaked, which keeps access alive |
xwfp- | Workflow token | A workflow step, without user scopes | Expires 15 minutes after issue or when the step ends | Usually low value once expired; find the workflow that logged it |
Then confirm what the token is with one read-only call:
- Call
auth.testfrom a controlled host, and note its IP. It needs no scopes and returnsteam_id,user_id, the workspaceurl,bot_idfor bot tokens andenterprise_idfor Enterprise organisations. - Read the error if it fails.
token_revokedortoken_expiredmeans the token is already dead, but you still need to investigate what it did while valid.account_inactivemeans a bot token for a deleted user or workspace. - Map the bot or user to an app. For a bot token, find the app that owns the
bot_idin 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. - 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.
| Source | Plan | Access | What it answers | Limits to know |
|---|---|---|---|---|
Access logs (team.accessLogs and the admin Access logs page) | Paid plans; free workspaces get paid_only | User token with admin scope; workspace or org owners and admins in the UI | Which IP, user agent, ISP and approximate location accessed as a member, with first seen, last seen and count | Entries 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 plans | User token with admin scope | When an app was added, removed, enabled, disabled, updated or had scopes expanded, by which user, with which scopes | Records changes to the integration, not API calls made with it |
Audit Logs API (https://api.slack.com/audit/v1/logs) | Enterprise plans only | auditlogs:read user token from an app installed on the organisation by the org owner | App installs and scope changes, file downloads, exports, sessions, logins and anomaly events, with IP, user agent and session ID in context | Records 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_installedaudit 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.testfirst returnedtoken_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.accessLogsfor the exposure window (setbeforeto 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 whosedate_firstfalls inside the window and which do not match the app's known hosting. - All token types on Enterprise: query the Audit Logs API with
actorset to the user or bot user ID and readcontext.ip_address,context.uaandcontext.session_id. Events triggered by an app carry anappobject with its ID, name,scopesandscopes_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 reason | Applies to | What it suggests for a token investigation |
|---|---|---|
ip_address (details new-asn, cloud-asn, in-ioc-list) | App, user | Token used from a network outside its history; a cloud ASN is common for scripted reuse |
asn, tor | App, user | Source on a suspicious ASN list or a Tor exit node |
unexpected_credential_testing | App | Someone checked whether the credential works, often the first step after a leak |
excessive_downloads, excessive_file_shares | App, user | Bulk file collection or files shared outward |
unexpected_scraping, unexpected_api_call_volume | User | Scripted bulk reading with a user token |
user_agent, unexpected_client, session_fingerprint | User | Client 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 (
scopefield) or the auditappobject. History scopes such aschannels:historyandgroups:historymean 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_downloadedevents 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_startedand the matching_downloadedevents. 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_updatedandapp_collaborator_addedduring the window, especially by the compromised user. - Preserved tokens:
app_token_preservedmeans a token was kept rather than revoked during a change; confirm it was intended. - Integration log changes:
change_typeofadded,expandedorenabledon 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.
| Finding | Severity guide | Response |
|---|---|---|
Token exposed, no use outside known infrastructure, narrow scopes (for example chat:write only) | Low | Revoke, reissue, fix the leak source, record the review |
| Token used from unknown IPs, no history or file scopes | Medium | Revoke, check for spam or phishing messages posted as the bot, warn channel members |
| Unknown use with history, file or search scopes | High | Full containment, data owner notification, assess personal data in readable channels |
| User token of an admin or owner, or persistence found | Critical | Treat 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:
- Revoke the token. Call
auth.revokewith the leaked token. You can run it withtest=1first 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. - 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. - Reset the user's sessions for user tokens. On Enterprise plans,
admin.users.session.reset(scopeadmin.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. - 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.
- 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.
- Verify, and hold the reissue. Do not reissue until Step 7 is done. Run
auth.testwith the old token and confirmtoken_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
| Framework | Reference | How it applies |
|---|---|---|
| MITRE ATT&CK | T1528 Steal Application Access Token | How the token is obtained, for example from a vendor or code store |
| MITRE ATT&CK | T1550.001 Application Access Token | Reuse of the stolen token against the Slack API |
| MITRE ATT&CK | T1213.005 Messaging Applications | Collection of messages and files from Slack |
| MITRE ATT&CK | T1552.001 Credentials In Files | Tokens left in repositories, configuration files and logs |
| NIST CSF 2.0 | DE.AE-02, RS.AN-03, RS.MI-01 | Analysing the events, establishing what happened, containing the incident |
| NIST SP 800-53 Rev 5 | IR-4, AU-6, IA-5 | Incident 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.testcall 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
- Slack: Tokens
- Slack: Audit Logs API methods and actions reference
- Slack: Anomalous events reference
- Slack: team.accessLogs method
- Slack: team.integrationLogs method
- Slack: auth.revoke method
- Slack: Best practices for security
- NIST: SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management
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