Which Insecure Defaults Should You Fix Before Launch?
These are settings that make building easier and leave a live app open: debug mode, detailed error messages, wide-open CORS, test-mode database rules, leftover admin accounts and test routes, and no rate limits. You can test each one from outside the app in a few minutes.
Review this app's production configuration as an attacker would. For each item report the current setting, the file, the risk and the exact fix. Don't change anything yet.
1. Debug: debug=True, DEBUG settings, NODE_ENV, or a development server running in production.
2. Errors: add one central handler. Clients get a generic message and a request ID. Stack traces, SQL and file paths go only to server logs.
3. CORS: if the browser only calls my own domain, remove CORS. Otherwise replace * or a reflected origin with an allowlist:
const allowed = new Set(["https://[MY_DOMAIN]"]);
const origin = request.headers.get("origin");
const headers = new Headers({ Vary: "Origin" });
if (origin && allowed.has(origin)) {
headers.set("Access-Control-Allow-Origin", origin);
}
4. Leftovers: seeded admin accounts, default passwords, /api/debug, /api/seed, test login bypasses, sample pages, and verify_jwt = false on any user-facing Supabase function.
5. Data rules: Firebase rules containing if true, Supabase policies using (true) on private tables, and public storage buckets holding private files.
6. Limits: add per-user and per-IP rate limits to login, password reset, email, SMS, uploads and AI routes, and tell me which providers need a spending limit set in their dashboards.
7. Keys: production uses live keys, and every other environment uses test keys. Flag any test key in production or live key elsewhere.
8. Headers: list missing security headers.
Output a table sorted by risk, then wait for me to approve the fixes.
- Debug mode and detailed errorsSend bad JSON. Expect no stack trace.
- Wide-open CORSSend a foreign origin. It must not be echoed.
- Test-mode database rulesFirebase test mode grants access to everyone
- Leftover routesProbe /.env and /api/debug, then read the body
- Leftover admin accountsRemove them and change default passwords
- No rate limitsRequest 20 quick resets. Expect refusals.
- #1Broken access control
- #2Security misconfigurationUp from fifth
- #3Software supply chain failures
Try it now
- 1Force an error:
curl -i -X POST https://<YOUR_DOMAIN>/api/<ROUTE> -H "Content-Type: application/json" -d '{bad json'. A stack trace, file path or SQL in the reply is a fail. - 2Probe for leftovers with
curl -ion/.env,/.git/config,/api/debugand/admin. Read the body rather than just the status code, because many apps return200and their home page for any address. - 3Check CORS:
curl -i -H "Origin: https://example.com" https://<YOUR_DOMAIN>/api/<ROUTE>. If the reply saysAccess-Control-Allow-Origin: https://example.com, your API trusts any site. - 4Scan your domain with MDN's HTTP Observatory, then request a password reset 20 times quickly. It worked when errors are generic, leftovers are gone, the origin isn't echoed, and the resets get refused.
Use it when
Before you share a public link, after any change to hosting or config, and whenever an AI's fix mentions CORS, permissions, policies or environment settings.
Skip it when
Local development and access-protected previews can keep detailed errors, since that's what they're for. And don't switch on a strict Content Security Policy on launch day without testing it. It can block your own scripts, so try it on a preview first (rule of thumb, not a vendor figure).
Why it works
OWASP ranks security misconfiguration second in its Top 10:2025, up from fifth. Its list reads like a vibe coding session: unneeded pages and accounts left enabled, default passwords unchanged, stack traces reaching users, and insecure framework settings.
The damage can be severe. Flask's docs say its debugger allows arbitrary Python to run from the browser, and that its PIN shouldn't be relied on for security. Detailed errors show attackers your component versions, which they can match to known flaws, as OWASP describes.
Missing limits cost money. OWASP's API guide describes a script repeating a password reset so that every call triggers a paid text message. The same applies to email and AI calls, so it advises rate limits, tighter limits on sensitive actions, and spending limits with each provider.
Rule of thumb, not a vendor figure: an AI tool tends to reach for whatever clears the current error, and a permissive setting clears it quickly. Nothing tells you when the error it cleared was protecting you.
Example
A signed-in dashboard fails with a CORS error, and the AI suggests Access-Control-Allow-Origin: *. MDN explains that browsers block this wildcard on requests with credentials, so the error stays. The next suggestion reflects whatever origin was sent, with credentials allowed. The error goes away, but any website a signed-in user visits can now read their data from your API.
The curl test in step 3 catches this immediately. The allowlist in the prompt fixes it, and the header tells caches that the reply varies by origin. If your front end and API share a domain, the better fix is to remove CORS entirely, since OWASP advises keeping CORS use to a minimum.
Going further
CORS isn't access control. MDN describes it as a rule that browsers enforce, so curl and scripts ignore it entirely. Fixing CORS without login checks protects nothing.
Test and live modes can catch you out in both directions. Stripe keeps separate keys and objects for each mode, so test price IDs fail in live mode. Lovable's Stripe docs add a trap: the preview has no separate test environment, so with a live key, payments in the preview are real.
Supabase can rate limit Data API writes with a pre-request function, but only POST, PUT, PATCH and DELETE. Reads can't be limited that way. Its security lints also flag anonymous sign-ins as 0012_auth_allow_anonymous_sign_ins, which is worth checking if you never meant to allow them.
The tools have their own defaults too. Claude Code's bypassPermissions mode removes its safety checks, and its docs limit it to isolated environments. On Lovable, admins can turn on Block publishing with critical issues.
Common mistakes
- Testing only your preview. Production has its own settings, so run these checks against the live domain.
- Reflecting the request's origin to silence a CORS error. It looks like an allowlist and behaves like no check at all.
- Leaving
verify_jwt = falseon a user-facing Supabase function. Supabase says this removes the platform's check, so your code becomes the only thing verifying the caller. - Adding rate limits in the browser. Limits only count on the server, where the caller can't remove them.
Sources
- A02 Security Misconfiguration, OWASP Top 10:2025
- A01 Broken Access Control, OWASP Top 10:2025
- API4:2023 Unrestricted Resource Consumption, OWASP
- Debugging application errors, Flask docs
- CORS, MDN
- HTTP Observatory, MDN
- Avoid insecure rules, Firebase docs
- Securing Edge Functions, Supabase docs
- Securing your API, Supabase docs
- Database advisors, Supabase docs
- API keys, Stripe docs
- Stripe integration, Lovable docs
- Security overview, Lovable docs
- Permission modes, Claude Code docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.