Dev.to Security 🔐 Cybersecurity 👁 2 📖 2 min read

Is a Sentry DSN in your JavaScript a leak? What to check instead

You search your built JavaScript for key and find a Sentry DSN. Is that a leak? Usually no. But a different Sentry string next to it can be. What a DSN is A Sentry DSN is the address your front end uses to se

You search your built JavaScript for key and find a Sentry DSN. Is that a leak? Usually no. But a different Sentry string next to it can be.

What a DSN is

A Sentry DSN is the address your front end uses to send error reports. It looks like a URL with a public key and a project number. Sentry designs it to be visible in browser code, because the browser has to send reports somehow. Seeing a DSN in your bundle is expected.

What can still go wrong

  • Spam events. Anyone who copies your DSN can send fake errors to your project. That can fill your quota and bury real problems. Sentry has settings to limit this, such as allowed domains and rate limits on the project.
  • An auth token in the bundle. Build tools upload source maps with a Sentry auth token. That token is a secret. If it is set as a front-end environment variable, it ships to every visitor. Auth tokens belong in your build environment only, never in client code.
  • Source maps left public. If you upload source maps to Sentry, you do not need to also publish them on your site. Public source maps show your original code to strangers.
  • Sensitive data in events. Error reports can include URLs, form values and user details. Review what your setup sends and scrub what it should not.

How to check your own app

  1. Search your production JavaScript for sentry and for strings that look like tokens, such as sntrys_. A DSN is fine. A token is not.
  2. Check whether .map files are reachable on your live domain.
  3. Open the Sentry project settings. Set allowed domains, turn on rate limits and review data scrubbing.
  4. Check your build settings. Confirm the auth token is a server or CI variable, not one with a public prefix such as NEXT_PUBLIC_ or VITE_.

Why this shows up in AI-built apps

An assistant that wires up error tracking often puts every Sentry value in the same .env file. If the file uses a public prefix, all of it ships to the browser.

Check the outside view

I work on ProofForge. The free scan checks the public side of a URL you own or have permission to test: browser bundle, public files, headers and supported backend signals. It never signs in. A clean result means nothing was found in the public assets checked, not that the app is secure.

Run the free scan on the live URL. Run the free ProofForge scan. No account needed. Only scan apps you own or have permission to test. More guides: the index.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.