Slack legacy tokens come from older ways of integrating with Slack: workspace tokens and the original bot-and-user tokens that predate today’s granular app permissions. Slack has retired or deprecated these models, but a token that was never revoked may still be valid. Such a token tends to have broad access to a workspace, since it was issued before scopes were fine grained, and it may act as the user who created it. That is why a leaked legacy token deserves the same urgency as a current one: it may open channels, messages and files. Revoke it first, then investigate what it could see.
Check your GitHub account for leaked secrets — free
- Provider
- Slack
- Severity
- High
- Impact
- SaaS account access and billing
- Checked live by LeakWatch
- No
What a Slack Legacy Token looks like
Legacy tokens start with xox followed by o or a, and then dash-separated parts:
xoxo-NNNN-NNNN-NNNN-hhhh… combined legacy token: three numeric ids, then hex (masked)
xoxa-XXXX… workspace token (masked): a letters-and-digits body after the prefix
The first form, xoxo-, is followed by three groups of digits and a hexadecimal tail. The second form, xoxa- or xoxo-, is followed by a body of 8 to 48 letters and digits, sometimes preceded by a single digit and a dash. They show up as SLACK_TOKEN or SLACK_LEGACY_TOKEN in old bots, scripts, build files and integration configuration. The most important distinction is with the current tokens: bot tokens start with xoxb- and user tokens with xoxp-, and those are covered by Slack API token. An xoxa- prefix is also used by some current app tokens, so the prefix alone does not prove that a token is legacy.
How Slack Legacy Tokens get leaked
- Old bots and scripts. Projects started when legacy tokens were the easy option, never updated, with the token in the source or a config file.
- Forgotten repositories. Archived or personal repositories that were made public, with the token still in the history.
- Backups and dotfiles. Shell profiles,
.envfiles and chat client configuration copied into a public dotfiles repository. - Integration configuration. A third-party tool’s settings file with the token pasted in, exported or shared for support.
- CI definitions. An old pipeline posting build results to Slack with the token written in the file.
What to do in the first hour
- Revoke the token. Use the Slack API site to find the legacy token page of the person who generated it, or the app that issued it, and revoke it. If you cannot find the page, consider whether migrating to a current app with scoped tokens is the better answer, and revoke access for the integration in the workspace settings.
- Replace it with a current token. Create a Slack app with only the scopes needed, install it and use its bot token. Store it in a secret manager and deploy it.
- Identify who generated it. A legacy token acts as a person, so find out whose it was and what that person can see. If it belonged to an admin, treat the exposure as larger.
- Audit activity. Workspace owners and admins can review access logs and, on plans that include it, audit logs. Look for logins or API calls from unknown addresses, exports, new apps, new webhooks and changes to membership.
- Check what was created. Review installed apps, incoming webhooks and custom integrations, and remove any you do not recognize. Rotate any webhook URL that was exposed; see Slack webhook URL.
- Clean up the code and its history. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at Slack
Legacy tokens are tied to the account or the integration that issued them, and Slack has been moving people away from them. Start from the Slack API console, signed in as the owner of the token or as a workspace admin, and look for the section where tokens or installed apps are listed. If you cannot find the legacy token, an admin can remove the integration from the workspace. A person has not confirmed the exact menu wording for this guide, and the interface can change, so follow the Slack documentation at https://docs.slack.dev/ for the current way to revoke or retire legacy tokens.
How LeakWatch detects it
There are two rules. The one called Slack Legacy Token matches xoxo-, three numeric groups separated by dashes and a hexadecimal tail, so xoxo- followed by anything else is not reported. The one called Slack Legacy Workspace Token matches xoxa- or xoxo-, then an optional single digit and dash, then 8 to 48 letters and digits. A shorter body is ignored, and the other prefixes (xoxb-, xoxp-) are left to other rules. Neither rule needs a variable name. The severity of both is high. Because xoxa- can also appear in a current token, a match is worth checking by hand. This type is not checked live: LeakWatch does not send any request to Slack with the token it found.
LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.
FAQ
Are legacy tokens still valid?
They can be, if they were never revoked. Slack has deprecated the models that issued them, but do not assume that an old token is dead. Treat a leak as real until you have revoked it.
What is the difference with a bot token?
A bot token starts with xoxb- and has scopes chosen when the app was installed. A legacy token comes from older, broader permission models and may act as a person.
Should I just migrate instead of revoking?
Do both. Revoke the leaked token now, and move the integration to a current Slack app with narrow scopes so that you do not depend on legacy tokens again.