CCyberwiki

Security checklist before launch

A security checklist before launch covers the settings and code whose omission leaves data exposed or accounts open to takeover, and it is run when a project moves from testing to production.1 For an application on Next.js and Supabase, Securing a Next.js and Supabase application gives the steps in order.

1. Keep secrets out of the repository and the browser

A secret committed to a repository can be read by everyone with access to the repository and its history, and a value written into front-end code reaches every visitor. In Next.js, .env.* files go in .gitignore, and only variables meant to be public carry the NEXT_PUBLIC_ prefix.2

# .gitignore
.env*

Keys that grant more than the public key, such as a Supabase service role key key, belong in server code only (see Privileged key in client-side code). GitHub's push protection blocks a push that contains a credential before it reaches the repository. It is on by default for personal accounts pushing to public repositories; for a repository it requires GitHub Secret Protection and an administrator to turn it on.3

2. Turn on row level security for every table

Supabase's Data API accepts the publishable key, and that key ships inside the application, so anyone can call the API.1 Row level security (RLS) policies decide which rows each request may read or change. A table without RLS and sensible policies can be read and changed by any client; the switch is in Database > Tables.1 Tables made in the Table Editor have RLS on by default; tables made with SQL need a statement:4

ALTER TABLE public.todos ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Users can view their own todos"
  ON public.todos FOR SELECT TO authenticated
  USING ((SELECT auth.uid()) = user_id);

A policy of USING (true) on private data leaves RLS on while letting every request through.4

CVE-2025-48757 records this failure in applications generated by the Lovable app builder up to 15 April 2025. Their front ends queried the database with the anon key and relied on RLS alone; where policies were missing or too broad, a visitor with no account could edit a request to ?select=* and read whole tables, personal data and credentials included.4 NVD lists a CVSS 3.1 score of 9.3 (Critical) from MITRE and the weakness CWE-863; Lovable disputes the entry, holding each customer responsible for the data of their own application.5

3. Check authorization inside every server function

Hiding a button leaves the server route behind it open to direct requests. Each Server Action has to check authentication and Authorization itself instead of relying on Proxy, layout or page checks alone, and database queries belong in a server-only data access layer.2

4. Tighten sign-up and sign-in

In Supabase, Authentication > Sign In / Providers holds email confirmation, which is turned on, and the one-time password expiry, set to 3600 seconds or lower. That value also limits how long confirmation, recovery and invitation links work.1

Login, password reset and recovery should answer with one generic message whether the password was wrong or the account does not exist, so the answers cannot reveal which accounts exist.6 A rate limit on these routes guards against abuse7 and slows Brute-force attack and Credential stuffing.

Administrator accounts need two-factor authentication, on the Supabase account itself or on GitHub when the account signs in through GitHub, since the GitHub account then holds administrative rights over the organization. A second owner in Organization > Team keeps the project reachable if one owner loses access.1

5. Serve HTTPS only and send security headers

The Strict-Transport-Security (HSTS) header makes the browser use HTTPS for the site even when someone types an http address. The values below keep HSTS for two years, subdomains included, and add three other headers:8

Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Referrer-Policy: strict-origin-when-cross-origin

With a long HSTS lifetime, an expired or revoked certificate keeps visitors out until the lifetime ends.8 A Content Security Policy limits where scripts load from, which defends against cross-site scripting and clickjacking.27 See HTTP security headers.

6. Pin and audit dependencies

A committed lockfile pins dependency versions.7 npm audit sends the dependency list to the registry and reports the known vulnerabilities in it. By default it needs a package-lock.json, and it exits with a non-zero code on a finding, so a build can stop on it; --audit-level sets the lowest severity that fails.9 See Vulnerable dependencies.

npm audit --audit-level=high

7. Confirm that backups exist

Supabase backs up Pro, Team and Enterprise projects daily, keeping 7, 14 and up to 30 days. Point-in-time recovery, a paid add-on, restores to a chosen moment within seconds. On the free plan, export the database with supabase db dump and keep the file somewhere else. Database backups leave out files in Supabase Storage.10 See Backup and restore.

8. Restrict deployments and keep logs

On Vercel, Deployment Protection keeps unauthorized people out of deployments, Log Drains keep a copy of deployment logs, and access roles set what each team member may change.7

9. Publish a security contact

RFC 9116 defines security.txt, a machine-readable file at a known location on the site that tells researchers how to report a vulnerability. It was written because many researchers found no channel for reports.11 Each line is a field and a value, as in Contact: mailto:security@example.com. Handling reports is covered in Handling a vulnerability report.

10. Review the risks specific to the application

The last check is a threat review: work out how an attacker could abuse the application, mitigate each risk, and compare the design with the OWASP Top 10 (see Threat modelling). The whole checklist is run again when sign-ups open and when tables, sign-in methods or team members are added.1

Prompt for a coding agent

Check this project before launch and report before changing anything: secrets in code, committed .env files or git history; keys other than the public one in browser code; tables without row level security or with USING (true) policies; server routes and actions that do not check the user and their right to the record; sign-in and reset routes that reveal whether an account exists or have no rate limit; missing HSTS, nosniff, framing, Referrer-Policy and Content Security Policy headers; npm audit findings. Give the file and line and a proposed fix for each.

In SecFlash

On the Security page, SecFlash reports a secret in the code or its history as SF-SEC-702, a service_role key in browser code as SF-SEC-724, a sign-in route with no rate limit as SF-SEC-727, missing HSTS as SF-SEC-101, a missing content security policy as SF-SEC-103 and a vulnerable dependency as SF-SEC-701. A secret key in public JavaScript appears on the Exposure page as SF-EXP-301, next to Supabase tables readable without login (SF-EXP-213). The Cloud page holds the platform settings: a table without row level security (SF-CLD-501), sign-ups that skip email confirmation (SF-CLD-530), push protection turned off (SF-CLD-605) and a Supabase database with no recent backup (SF-CLD-525).

See also

References

  1. a b c d e f "Production security checklist". Supabase Docs. Supabase.
  2. a b c "How to optimize your Next.js application for production". Next.js Docs. Vercel.
  3. back "Push protection". GitHub Docs. GitHub.
  4. a b c Palmer, M (2025). "CVE-2025-48757". mattpalmer.io.
  5. back NIST (30 May 2025, modified 17 June 2026). "CVE-2025-48757". National Vulnerability Database.
  6. back "Authentication Cheat Sheet". OWASP Cheat Sheet Series.
  7. a b c d "Production checklist for launch". Vercel Docs. Vercel.
  8. a b "HTTP Headers Cheat Sheet". OWASP Cheat Sheet Series.
  9. back "npm-audit". npm Docs.
  10. back "Database Backups". Supabase Docs. Supabase.
  11. back "RFC 9116: A File Format to Aid in Security Vulnerability Disclosure". IETF.