A developer, a security consultant and a random guy from the internet walk into your web app. Only one of them needed a password.

Fair warning: this is a long one. Grab a coffee. It's still shorter than the incident report you'd write otherwise.

There are two versions of your app. One lives in your repo, with code review, a .gitignore and an auth middleware you wrote carefully on a Tuesday. The other one is whatever your server actually answers when someone types a URL. Attackers only ever meet the second one, and it is usually less tidy than you think.

Below is the pass I run on a web app before it goes live, and again after any big deploy. No scanners, no paid tools: a browser, curl, dig and about fifteen minutes. Every step is something a curious stranger can do without logging in, which is the point. If a stranger can do it, so can you, first.

One rule before we start: run this against apps you own or have written permission to test. Everything here is passive or close to it, but "I was just checking" is not a legal defence anywhere I know of.

1. Read your JavaScript bundle like it's someone else's

Everything your frontend needs to run is shipped to every visitor. That includes any string a build tool decided to inline, and build tools are very obedient.

The classic way it goes wrong is the env var prefix. Each framework has one, and it means this value goes into the browser bundle:

Framework Prefix that gets shipped to the browser
Vite VITE_
Next.js NEXT_PUBLIC_
Create React App REACT_APP_
Expo EXPO_PUBLIC_
Nuxt anything under runtimeConfig.public

Someone adds VITE_STRIPE_SECRET because the plain name "didn't work" in the frontend. It works now. It also works for everyone else.

To check, pull the scripts your homepage loads and grep them for key shapes that should never be public:

SITE="https://example.com" curl -s "$SITE" \ | grep -oE '(src|href)="[^"]+\.js"' \ | cut -d'"' -f2 | sort -u \ | while read -r path; do case "$path" in http*) url="$path" ;; *) url="$SITE$path" ;; esac curl -s "$url" | grep -oE \ 'sk_live_[0-9A-Za-z]{20,}|sk-(proj|ant)-[0-9A-Za-z_-]{20,}|AKIA[0-9A-Z]{16}|ghp_[0-9A-Za-z]{36}|github_pat_[0-9A-Za-z_]{40,}|xox[bp]-[0-9A-Za-z-]{20,}|SG\.[0-9A-Za-z_-]{20,}' \ | sed "s|^|$path: |" done 

That catches Stripe secret keys, OpenAI and Anthropic keys, AWS access keys, GitHub tokens, Slack tokens and SendGrid keys. Two caveats. Modern apps lazy-load most of their code, so the homepage only shows you the first chunks. For the rest, click through the app with DevTools open, then use Sources → Search in all files (Ctrl+Shift+F, Cmd+Option+F on a Mac). And some keys are public on purpose: Stripe pk_live_, Firebase config, Google Maps AIza... keys. Those are fine as long as they're restricted to your domain in the provider's dashboard. Check that they are.

There's a sneakier version of the same leak: your key isn't in the bundle, but your backend has an endpoint like /api/chat that forwards anything it receives to OpenAI. If that endpoint has no auth and no rate limit, your key is effectively public anyway. Someone just has to find the URL, and it's right there in the Network tab.

Found a real secret? Rotate it first, then remove it from the code. Deleting it from the repo doesn't un-ship it from every CDN cache and every browser that already downloaded it.

2. Check whether you're serving your source code

Minified JavaScript is annoying to read. A source map fixes that for you, and for anyone else who asks. With one, DevTools rebuilds your original files: real variable names, folder structure, comments like // TODO: check permissions here, the admin routes you hid behind a feature flag, and the internal API base URL you forgot was in a config file.

The defaults mostly protect you. Vite's build.sourcemap is off for production, and Next.js keeps productionBrowserSourceMaps off. Create React App generates them unless you set GENERATE_SOURCEMAP=false. Where it usually goes wrong is error tracking: you turn source maps on so Sentry or a similar tool can show readable stack traces, the plugin uploads them, and they also get deployed next to the bundle.

Check the end of each bundle for a pointer, then try fetching the map directly. The second request matters, because "hidden" source maps drop the comment but the file can still be sitting there:

JS="https://example.com/assets/index-3f9a1c.js" curl -s "$JS" | tail -c 200 | grep -o 'sourceMappingURL=.*' curl -s -o /dev/null -w "%{http_code} %{size_download} bytes\n" "$JS.map" 

A 200 with a size in the hundreds of kilobytes means your source is public. If you need maps for error tracking, upload them during the build and delete them before deploy. Most of the plugins have an option for exactly that, for example filesToDeleteAfterUpload in Sentry's bundler plugins.

3. Ask for the files nobody meant to deploy

A lot of breaches start with a plain GET for a file that should never have left a laptop. The usual list:

  • /.env, /.env.production, /.env.local: database URLs, API secrets, everything
  • /.git/HEAD and /.git/config: if these load, the whole repository can usually be rebuilt, history included, along with every secret that was ever committed and "removed"
  • /.DS_Store: a macOS file that lists the folder's contents, including the ones you didn't link to
  • /backup.zip, /db.sql, /dump.sql: someone's "just for a minute" from two years ago
  • /phpinfo.php, /server-status, /actuator/env: debug pages that print the server's configuration

Here's the trap that makes people think they're safe, or think they're doomed. Single-page apps usually have a catch-all route: any unknown path returns index.html with status 200. So a status code alone tells you nothing. Look at what actually comes back:

SITE="https://example.com" for p in .env .env.production .git/HEAD .git/config .DS_Store backup.zip db.sql phpinfo.php server-status; do printf '%-18s ' "$p" curl -s -m 10 "$SITE/$p" -o /tmp/probe -w '%{http_code} %{size_download}b ' head -c 60 /tmp/probe | tr '\n' ' ' echo done 

If every line starts with <!doctype html> and has the same size, that's just your SPA shell. Fine. What you don't want to see is ref: refs/heads/main from .git/HEAD, [core] from .git/config, or a line like DATABASE_URL= from .env.

The fix is boring and permanent: deploy a build folder, not your project folder. If your server's web root is the repo root, every file in the repo is one URL away.

4. Find out what your API does when the frontend isn't there

This is the one that matters most, and no header scanner will ever find it. Your UI hides the "Delete" button from users who shouldn't have it. Your API has no idea what your UI hides.

OWASP puts it at the top of its API Security list for a reason: Broken Object Level Authorization. In plain words, GET /api/invoices/1042 returns invoice 1042 to whoever asks, as long as they're logged in as someone. A large-scale real example: in 2025, a researcher found that 170 of 1,645 apps built with one popular AI app builder let anonymous visitors read or write database tables directly, because the backend relied on the frontend to filter data (CVE-2025-48757).

To test it you need two normal accounts, A and B, and ten minutes:

  1. Log in as A. Open DevTools → Network and use the app normally: open a profile, an order, a document, a settings page.
  2. Right-click any API request that returns A's data → Copy → Copy as cURL.
  3. Replay it three ways: as is (should work), with the Cookie or Authorization header deleted (should fail with 401), and with B's session token pasted in (should fail with 403 or 404).
  4. Change the ID in the URL to one of B's IDs, still using A's session. Sequential numbers make this trivial. UUIDs only make it slower, not safe, because IDs leak through URLs, emails and other API responses.

Then try the write side, which people forget. Take a request that updates A's profile and add fields the form never sends:

curl -X PATCH "https://example.com/api/users/me" \ -H "Authorization: Bearer $TOKEN_A" \ -H "Content-Type: application/json" \ -d '{"name":"A","role":"admin","plan":"enterprise","email_verified":true}' 

If any of those extra fields stick, that's mass assignment: the server copies the request body straight onto the record. The fix is an allowlist of fields per endpoint (strong parameters in Rails, a schema validator like Zod or Pydantic elsewhere), never a blocklist.

While you're in the Network tab, read the responses too. APIs often return far more than the UI shows: other users' emails in a "team" endpoint, internal flags, sometimes a password hash. If the UI doesn't display a field, ask why the API sends it.

5. See who else your API will talk to, and where the session lives

CORS is the browser asking your API: "a page on some other site wants to read your response, is that OK?" The dangerous answer is "yes, and send the user's cookies along". That combination lets any website a logged-in user visits read their data from your API, quietly, in the background.

Browsers refuse Access-Control-Allow-Origin: * together with credentials, so the bad configuration is usually more creative: the server copies whatever Origin it receives back into the response. Test it with an origin you obviously don't own:

curl -s -o /dev/null -D - "https://api.example.com/api/me" \ -H "Origin: https://evil.example" \ -H "Cookie: session=<your session cookie>" \ | grep -i '^access-control' 

If you see access-control-allow-origin: https://evil.example next to access-control-allow-credentials: true, any site can read that endpoint as your logged-in users. Try two more origins while you're at it: null (sandboxed iframes send that) and https://example.com.evil.example, which catches allowlists built with a careless "ends with" or "contains" check. The fix is an exact list of origins you trust, compared as whole strings.

Now the session itself. Open DevTools → Application and look at two places.

  • Cookies. A session cookie should have HttpOnly (JavaScript can't read it), Secure (HTTPS only) and SameSite=Lax or Strict (not sent on most cross-site requests). Missing HttpOnly means one XSS bug, or one compromised third-party script, walks away with every session.
  • Local Storage. If your access token lives here, any script on the page can read it, including the analytics snippet, the chat widget and whatever they load. That's a trade-off some apps accept, but make it a decision, not a default someone copied from a tutorial.

One last check: log out, then replay a request you copied before logging out. If it still works, logout only deleted the token in your browser. Long-lived JWTs with no server-side revocation behave exactly like that.

6. List the subdomains you forgot about

Every TLS certificate a public authority issues is written to Certificate Transparency logs, and those logs are searchable by anyone. So the list of your subdomains isn't a secret, even the ones you never linked anywhere:

curl -s "https://crt.sh/?q=%25.example.com&output=json" \ | jq -r '.[].name_value' | tr 'A-Z' 'a-z' | sort -u 

(crt.sh is free and slow. If it times out, try again in a minute.)

Read the list with two questions in mind.

What's still running? staging., dev., old., beta., admin. are the usual suspects. They tend to run last year's build, with debug mode on, seeded test accounts and a database copied from production "just to test the migration". Open each one in a private window.

What points at something that no longer exists? That's a subdomain takeover. You delete a project on a hosting service but leave the DNS record pointing at it. Someone else creates a project with the same name on that service and now serves their content on your subdomain, with your cookies in scope if they're set on the parent domain.

for h in staging.example.com docs.example.com status.example.com; do printf '%-28s %s\n' "$h" "$(dig +short CNAME "$h")" done 

For every CNAME, open the subdomain. Messages like NoSuchBucket, There isn't a GitHub Pages site here or No such app mean the record is dangling. The community-maintained can-i-take-over-xyz list tracks which services can be claimed this way. The fix: when you shut a service down, delete the DNS record first, the service second.

7. Check who is allowed to send email as you

This isn't your app's code, but it's your users' trust. If your domain has no proper email policy, anyone can send a "Reset your password" email from support@yourapp.com, and plenty of inboxes will deliver it.

Two DNS lookups tell you most of it:

dig +short TXT example.com | grep -i 'v=spf1' dig +short TXT _dmarc.example.com 

What the answers mean:

You see Meaning
No SPF record Nobody has said which servers may send for you
SPF ending in ~all Soft fail: mail from other servers gets flagged, usually still delivered
SPF ending in -all Hard fail: mail from servers not on the list should be rejected
No DMARC record Receivers decide on their own what to do with spoofed mail
p=none Monitoring only. Spoofed mail is reported to you, not blocked
p=quarantine or p=reject Spoofed mail goes to spam or gets refused

Most apps I look at sit at p=none forever, because someone set it up to "watch first" and never came back. Read the reports it sends for a couple of weeks, make sure every real sender (your app's email provider, your helpdesk, your newsletter tool) passes SPF or DKIM, then move to quarantine and later reject.

Two smaller things. SPF allows at most 10 DNS lookups. Every include: counts, and past ten the whole record fails, so a domain that "supports" six email tools may effectively have no SPF at all. And domains that never send mail should say so explicitly: v=spf1 -all plus a DMARC record with p=reject. Otherwise your unused .io is a free phishing domain.

8. Headers, last and briefly

Security header scanners hand out letter grades, and people spend a whole afternoon chasing an A. Missing headers are real findings, but they're rarely how an app actually gets hurt. Everything above matters more. Still, one command:

curl -sI https://example.com | grep -iE '^(strict-transport|content-security|x-frame|x-content-type|referrer-policy|server|x-powered-by)' 

The ones worth your time:

  • Strict-Transport-Security: tells browsers to never use plain HTTP for your domain again. Cheap, set it.
  • Content-Security-Policy: the only header here that actually limits the damage of an XSS bug. A real one is work, because you have to list every script source you use. Start with Content-Security-Policy-Report-Only, read what would break, then enforce. Include frame-ancestors 'self' so nobody can load your app in an invisible frame and trick users into clicking (that also covers the old X-Frame-Options).
  • X-Content-Type-Options: nosniff: one line, stops browsers from guessing file types in creative ways.

And the noise: X-XSS-Protection is obsolete, modern browsers ignore it. Server: nginx/1.18.0 or X-Powered-By: Express tell people your versions. Worth removing, but hiding a version number doesn't fix that version's bugs, so patch first.

While you're looking at what the page loads, count the third-party scripts. Every analytics tag, chat widget and A/B testing tool runs with full access to your page, your DOM and anything in Local Storage. Each one is a company you're trusting with your users' sessions. Keep the list short, and know who's on it.

The run sheet

Check Time What bad looks like
Grep the JS bundle 3 min sk_live_, sk-proj-, AKIA... anywhere in shipped code
Source maps 1 min .js.map returns 200 and real source
Leftover files 2 min .git/HEAD says ref:, .env has KEY=value lines
API without the UI 5 min Account A reads or edits B's data, extra fields stick
CORS and session 2 min Your API echoes https://evil.example with credentials
Subdomains 1 min Old staging still up, CNAME pointing at nothing
Email policy 1 min No DMARC, or p=none for a year
Headers 30 s No HSTS, no CSP

The order is deliberate: most dangerous first, cheapest to fix last. If you only have five minutes, do the API check. It's the one no automated scanner gets right, because only you know who's supposed to see what.

None of this replaces a proper security review. It's the floor, not the ceiling. But I've seen a lot of apps go live without anyone ever looking at them from the outside, and that floor is where most of the real trouble lives. Fifteen minutes now beats an email to your users later that starts with "We take your privacy seriously".