Skip to content
Databases & keys · Secret guide

Leaked Dropbox Access Token: what to do in the first hour

High severityDetected onlyLast verified · 5 min read

A Dropbox access token lets whoever holds it call the Dropbox API as the account that authorized the app, within the permissions of that app. Depending on those permissions, that can mean listing, downloading, uploading, overwriting and deleting files, and sharing links to them. The main danger is the content of the files, which often includes backups, exports and documents never meant to be public, and the risk that files are changed or deleted. Revoke first, then investigate.

Check your GitHub account for leaked secrets — free

Provider
Dropbox
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
No

What a Dropbox access token looks like

Dropbox has issued several token shapes over the years, and LeakWatch recognizes three of them:

sl.XXXXXXXX…                     short-lived access token ("sl." plus 135 characters)
XXXXXXXXXXXAAAAAAAAAAXXXXXXXX…   long-lived access token (11 characters, ten A, then 43 characters)
XXXXXXXXXXXXXXX                  15 characters, short format (also the length of an app key or app secret)
  • Short-lived access token. Starts with sl. and is long. It expires after a few hours, and the exact lifetime is returned as expires_in when it is issued. A short-lived token is only dangerous while it is valid, but it is usually delivered together with a refresh token.
  • Refresh token. Does not expire by itself, and it can be used to mint new short-lived tokens. If a refresh token leaked, it is the real problem, whatever the access token says.
  • Long-lived access token. The older style, which did not expire. Dropbox no longer offers creating new ones, so one found today is an old token that still needs to be revoked.
  • App key and app secret. The identifiers of your app in the Dropbox App Console. They are 15 characters each, which is why the short-format rule can also match them.

Typical names are DROPBOX_ACCESS_TOKEN, DROPBOX_REFRESH_TOKEN, DROPBOX_APP_KEY and DROPBOX_APP_SECRET.

How Dropbox access tokens get leaked

  • Backup and sync scripts. A script that uploads database dumps or logs to Dropbox, with a token written in the file.
  • Committed environment files. DROPBOX_ACCESS_TOKEN in a .env, a compose file or a deployment manifest.
  • Old tutorials. The generated token on the app settings page, copied into sample code because it was the quickest way to test, then pushed.
  • Mobile and desktop apps. A token or app secret shipped inside an application package that anyone can unpack.
  • Notebooks and data projects. A shared notebook that read files from Dropbox, saved with its output and credentials.
  • CI pipelines. An artifact upload step with the token in plain text in a public pipeline definition.

What to do in the first hour

  1. Identify what leaked. Decide whether it is an access token, a refresh token, or the app key and secret. This tells you what to revoke.
  2. Revoke the token. Revoking the app authorization removes the access it granted, and an app can also revoke a token itself through the API. If the app secret leaked, generate a new one in the app settings. Also regenerate or revoke any generated access token shown there.
  3. Deploy new credentials to the application or secret store, then run the sync once to confirm it works.
  4. Check the activity. In the Dropbox account of the app owner, review the activity and events for the period since the exposure: files downloaded, shared, moved or deleted, and unfamiliar devices or apps. For a business account, the admin console exposes team activity and connected apps.
  5. Review shared links. Look for new shared links or shared folders that expose content to people outside the team, and remove the ones you did not create.
  6. Restore if needed. Dropbox keeps version history and deleted files for a limited time, so recover anything that was overwritten or deleted soon.
  7. Reduce the permissions. Where the app uses full Dropbox access, switch to an app folder and the smallest scopes it needs.
  8. Clean up the code and search for other secrets next to the token. 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 Dropbox

Dropbox apps and their credentials are managed in the Dropbox App Console of your Dropbox account, where each app has a settings page with its key, secret and permissions. Individual users can also remove an app from the list of connected apps in their account security settings. A person has not confirmed the exact menu wording for this guide, and the interface can change, so look for the section where your apps or connected apps are listed, and follow the Dropbox developer documentation for the revocation call of the API. After revoking, every system that used the old token must be updated.

How LeakWatch detects it

Three rules cover this type, and all of them need the word dropbox in any letter case near the value, then a short label, an assignment sign such as = or :, and optional quotes.

  • Dropbox API Token accepts a value of exactly 15 letters and digits. This is the short format and the length of an app key or secret.
  • Dropbox Long Lived API Token accepts 11 letters and digits, the marker of ten A characters, then 43 characters of letters, digits, -, _ or =.
  • Dropbox Short Lived API Token accepts sl. followed by 135 letters, digits, -, = or _.

A value of another length, a value without the word dropbox close to it, or one without an assignment sign is not reported. The severity of all three rules is high. This type is not checked live: LeakWatch does not send any request to Dropbox 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

My token starts with sl. and has expired. Am I safe?

The access token yes, if it has really expired. But check whether a refresh token or the app secret leaked in the same place, since those can create new access tokens.

Why was a 15-character value reported?

That length is also that of Dropbox app keys and secrets. It may be an identifier rather than an access token, but an app secret still needs to be rotated if it was exposed.

Will revoking the token delete my files?

No. It only ends the app’s access. Your files stay in the account, but review them for changes made while the token was exposed.

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

LeakWatch is not affiliated with Dropbox.