Skip to content
Leaked secrets Write-up Beginner

When I Found a Hardcoded Sentry Token in a JS Bundle — And

A Sentry API auth token with project read and write permissions was embedded in a production JavaScript bundle. An attacker who found it could use the token to access or modify the application's Sentry error tracking project.

Anshubind Follow

Published on medium.com

If you’re in bug bounty or security research long enough, you eventually run into that reply:

Anshubind, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

The token could allow an attacker to read and write to the Sentry project, potentially exposing stack traces, source maps, exception data and sometimes user identifiers or context.

What the attacker needed

Access to the public JavaScript bundle

How it was found

  1. Open the front-end JavaScript bundle for the target application.
  2. Read through the minified code and notice a Sentry API auth token.
  3. Extract the token safely without sharing or logging it publicly.
  4. Use Sentry's own API endpoints to confirm the token is valid without pulling sensitive content.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A JavaScript bundle is the file a website sends to your browser to make the page work. This file accidentally contained a secret password-like token for Sentry, a service that collects error reports. Anyone who opened the file could read the token and use it to reach the company's error tracking data.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by Anshubind

View all

15 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.