Guide · Leaked keys and files
Source maps and .git exposed in production: is your code downloadable?
Two leftovers can give anyone a readable copy of your code. A source map turns the squeezed-up JavaScript your visitors download back into your original files. A public .git folder is worse: it can be enough to rebuild your whole project and its history, including any key that was ever committed. The first is worth fixing. The second needs fixing today.
The two, at a glance
.map files behind your scripts, and none inside them.Worth fixing/.git/ answers from your site.Fix nowOn the right is how our checker rates each one when it finds it.
What a source map is
When your app is built, its code is bundled and minified: squeezed into a few files that are hard for people to read. A source map is a separate file that maps that code back to your original files. It lists their names, and it can carry their full original text (the source map standard). Developer tools use it to show you readable code while you debug (Chrome docs).
A public map gives away nothing your visitors’ browsers don’t already run. Anything secret in your front-end code is exposed either way (that’s its own guide). But a map adds the readable version: your file names, how the app fits together, your code as you wrote it. That makes mistakes easier to find. So our checker rates it Worth fixing, not Fix now.
Vite and Next.js leave browser source maps out of production builds unless you turn them on (Vite docs, Next.js docs). They usually get switched on later, to chase a bug in production or because an error tracker needs them.
How do I check for source maps?
- Open your live app and the developer tools (F12, or right-click › Inspect), then the Sources panel. If you see your own folders and file names, like
srcand your components, a map loaded. - To be sure, open the Network tab, reload, and click your main script (a
.jsfile). Copy its address, add.mapto the end, and open that in a new tab. - A long block of text with
"sources"and"mappings"in it means the map is public. A 404, or your app’s own page, means it isn’t.
Our checker does the same for the first three scripts on your page: it follows any map they name, notices a map embedded inside a script, and tries your first script’s address plus .map.
Turn them off
Prompt for Lovable, Bolt, Cursor or Claude Code
My production build publishes source maps, which can show anyone my original source code. Turn off public source maps in my build config (Vite: build.sourcemap = false, or 'hidden' plus deleting the .map files after my error tracker uploads them; Next.js: productionBrowserSourceMaps = false) and redeploy.
Using an error tracker like Sentry? It needs your maps, so its guide turns them on, uploads them while your app builds, and then has you delete them or block .js.map files on your server (Sentry docs). Don’t skip that last step. Vite’s 'hidden' setting only leaves out the line in each script that points to its map. The .map files are still built next to your scripts (Vite docs). So if they’re published, the address plus .map still works, and our checker still tries it.
A public .git folder
Git keeps your project’s history in a hidden folder called .git: which branch you’re on (HEAD), its settings (config) and a store of everything you’ve committed (git docs). It belongs on your computer and on GitHub, never on your website. It ends up public when the whole project folder gets uploaded instead of just the build output. That’s the same mistake that publishes a .env file.
Files from that folder can be enough to rebuild your code and its history, including any secret that was ever committed, even one you deleted in a later commit. That’s why our checker rates it Fix now.
Prompt for Lovable, Bolt, Cursor or Claude Code
My .git folder is publicly downloadable from my website. Change my deployment so only the build output folder is published, never the project root, and block every path starting with /.git. Then tell me which secrets ever appeared in my git history so I can rotate them.
Then change every one of those keys and passwords in its own service’s dashboard. Removing the folder stops new downloads, but it can’t take back a copy someone already made.
How do I check for .git?
Open yourapp.com/.git/HEAD in your browser, with your own address. A one-line answer that starts with ref: means your .git folder is public. A 404, or your app’s own page, means it isn’t. Our checker tries /.git/HEAD and /.git/config, and can tell a real file from your app’s page.
What this can’t tell you
We check from outside, once: the first three scripts on the page you give us, and two files in your .git folder. Other pages can load other scripts, so it’s worth checking an inner page too. We read just enough of each file to know it’s real, and never show or keep what’s in it.