Skip to content
Messaging · Secret guide

Leaked Slack App-Level Token: what to do in the first hour

High severityDetected onlyLast verified · 5 min read

A Slack app-level token belongs to a Slack app, not to a workspace member or a bot user. It starts with xapp- and is used for app-wide features, most commonly Socket Mode, where the app opens a WebSocket connection to Slack instead of exposing a public HTTP endpoint. Its scopes are things like connections:write, which lets the holder open those connections, and the app-level scopes granted when the token was created. On its own it does not read channels, but it lets an attacker receive the events and interactive payloads your app is subscribed to, and in some setups to impersonate your app’s event handler. Revoke the token first, then investigate.

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 App-Level Token looks like

An app-level token starts with the literal prefix xapp-, followed by a single digit, an identifier in capital letters and digits, a numeric part and a long lowercase and digit tail, all separated by dashes:

xapp-1-AXXXXXXXXXX-NNNNNNNNNNNN-xxxxxxxxxxxxxxxx…   Slack app-level token (masked)

The xapp- prefix is what separates it from the other Slack tokens: bot tokens (xoxb-), user tokens (xoxp-) and configuration tokens (xoxe). It typically appears in variables such as SLACK_APP_TOKEN, in Bolt framework initialization code (appToken) and in Socket Mode examples copied from the Slack documentation. A project that uses Socket Mode usually holds two Slack secrets side by side: this xapp- token and a bot token. If you find one in a leaked file, look for the other, and for the app’s signing secret and client secret.

How Slack App-Level Tokens get leaked

  • Bolt and Socket Mode starter projects. Tutorials tell you to export SLACK_APP_TOKEN next to the bot token, and people paste both into a .env file that is then committed.
  • Docker and compose files. The token written under environment: in a compose file or a Dockerfile for a Slack bot.
  • CI and deployment scripts. A deploy step that echoes variables, or a workflow file with the token inline instead of a repository secret.
  • Example configs. A config.yaml or manifest file shared in a gist, a support ticket or a public repository, where a real token replaced the placeholder.
  • Chat and screenshots. The app settings page captured in a bug report, with the token visible after it was generated.

What to do in the first hour

  1. Revoke the token. Open your app’s settings in the Slack API console (see the link below), find the section where app-level tokens are listed, and revoke the exposed one. Slack does not let you view a token’s value again after creation, so if you are unsure which entry leaked, revoke all the tokens of that app.
  2. Create a new token with only the scopes the app needs, store it in your secret manager and deploy it. Restart the app so its Socket Mode connection uses the new value.
  3. Check the app itself. Look at who is listed as a collaborator of the app, whether the event subscriptions, interactivity URL and slash commands still point where you expect, and whether the OAuth redirect URLs have changed.
  4. Review workspace activity. A workspace owner or admin can look at the app’s installation, the access logs and the audit logs available for your plan. Watch for the app doing things you did not build.
  5. Check the companion secrets. If the bot token, signing secret or client secret were in the same file, rotate them too. See Slack API token.
  6. Clean up the code. Remove the token from the files and the history, and put it in environment variables. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same repository? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Slack

App-level tokens are managed in the settings of the app in the Slack API console, after you sign in with an account that is a collaborator on that app. Open the app, then look for the section where app-level tokens are listed; it is usually found with the basic information of the app. Revoke the token there. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if the page differs from this description, follow the Slack documentation at https://docs.slack.dev/ for app-level tokens.

How LeakWatch detects it

The rule is called Slack App Token. It matches the text xapp-, then one digit, a dash, a run of letters and digits, a dash, a run of digits, a dash and a final run of letters and digits, in any letter case. A string that has the prefix but not the digit-and-segment structure is not reported, and neither are other Slack token families, which have their own rules. The rule needs no surrounding variable name. Its severity is high. 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

Can an app-level token read my Slack messages?

Not by itself. It is meant for connecting the app to Slack, for example over Socket Mode. But the events your app receives can contain message content, so treat a leak as a real exposure.

Is an app-level token the same as a bot token?

No. A bot token starts with xoxb- and calls the Web API as the bot user. An app-level token starts with xapp- and acts for the app. Many apps use both, so check for each.

Does revoking the token affect other apps?

No. The token belongs to one app, so only that app’s connections stop. Deploy a new token right after revoking so that your own bot reconnects.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Slack.