Your first check is free. No card needed.Run a free security check

The first hour after you find a data leak in your app

Write down the time, then work in this order: close the hole without deleting anything, rotate every key that could have been seen, and save your logs before your plan's retention removes them. Then work out what data was exposed, whose, and for how long, and check who you must tell: under the GDPR a controller notifies its supervisory authority within 72 hours of becoming aware, unless the breach is unlikely to put people at risk. This article is not legal advice.

Imagine an email at 9:40 on a Tuesday: "If I change the number at the end of my invoice link, I can see other people's invoices." You try it with a test account, and it is true.

The next hour decides a lot. Most breach checklists that rank today are written for companies with a legal team and a server room; the FTC's guide, sensibly for that audience, says not to turn machines off "until the forensic experts arrive". You have a Supabase project, a Vercel deployment and one other person on the team. This is the order we would work in.

Minute 0: start a log and write down the time

Open a plain document and write the time you learned about it, who told you and their exact words. Then log every action as you take it, with the time. Two reasons:

  • The GDPR requires the controller to "document any personal data breaches, comprising the facts relating to the personal data breach, its effects and the remedial action taken", reported or not (Article 33(5)).
  • The 72-hour clock runs from when you became aware. The EDPB says that is when you have "a reasonable degree of certainty that a security incident has occurred", and allows "a short period of investigation", but expects it to "begin as soon as possible" (EDPB Guidelines 9/2022). Your log shows when that moment was.

Thank the person who reported it and say you are looking into it. Nothing more yet.

Minutes 5 to 20: close the hole, keep the evidence

Stop further exposure with the smallest change that does it, and save the broken state before you change it. The FTC's rule fits any size of company: "Do not destroy evidence" (FTC guide).

What is exposedFastest way to close itDo not
A Supabase table readable through the APISave its policies, then enable row level security or drop the broad policyDrop the table or delete rows
Firestore or Realtime Database dataDeploy a deny rule for that pathDelete the collection
An API route that skips the owner checkDeploy with the route returning 503Delete the deployment
A public storage bucketMake it privateDelete the files
A leaked keySee the next sectionWait for it to be used

For the invoice example on Supabase:

-- 1. Save what the policies said, paste the output into your log
select policyname, cmd, roles, qual, with_check
from pg_policies where schemaname = 'public' and tablename = 'invoices';

-- 2. Close it. With RLS on and no policy, the API returns no rows
alter table public.invoices enable row level security;
-- if RLS was already on, drop the policy that was too broad instead:
-- drop policy "the policy name" on public.invoices;

Supabase's docs put it bluntly: "A table in an exposed schema without RLS is readable and writable by any role with a grant on it" (Supabase). Your app may break for that table. That is the right trade for an hour.

On Firebase, the locked-mode rule is allow read, write: if false;. Firebase says rules releases "take a period of several minutes to fully propagate" (Firebase), so retest after five minutes, signed out, from a private window.

Minutes 20 to 35: rotate what could have been seen

If any secret was in the exposed data, a public file, a client bundle or a commit, treat it as known to strangers. Supabase's advice comes first: "Fix the root cause of the leak before you rotate anything. Otherwise the new key can leak the same way" (Supabase: rotate leaked keys).

SecretWhat to doSide effect
Supabase secret keyCreate a new one, deploy it, delete the old one"Deleting a secret key can't be undone"
Supabase legacy service_role keyMove to the new keys, then deactivate the legacy ones; Supabase says the legacy keys can no longer be rotated (Supabase)"Retiring the compromised key deactivates both legacy keys"
Supabase legacy JWT secretRevoke it if sessions may be forged (Supabase signing keys)"Currently active users get immediately signed out"
Stripe secret keyRoll it and choose Now (Stripe)"If you choose Now, the old key is deleted"
Any variable on VercelChange it, then redeployChanges "only apply to new deployments" (Vercel)
A key committed to GitHubRotate it firstGitHub says rewriting history afterwards "may not be warranted" (GitHub)

The usual order is new key, deploy, then revoke the old one, so the app keeps working. If you can see the key being misused right now, revoke first and accept the downtime; Supabase says the same: "If someone is actively using the leaked key, retire it right away."

Minutes 35 to 50: save the logs before they expire

This step is the most time-sensitive one, and the generic checklists skip it. Request logs on small plans last hours or days:

PlatformRetention
Supabase API and database logsFree 1 day, Pro 7 days, Team 28 days, Enterprise 90 days (Supabase)
Vercel runtime logsHobby 1 hour, Pro 1 day, Enterprise 3 days, 30 days with Observability Plus (Vercel)
Firestore readsNot logged unless you turned them on: "Except for BigQuery, Data Access audit logs are disabled by default" (Google Cloud)

Filter the logs to the exposed table or route for the whole retention window and export or copy the results into your incident folder. Then snapshot the database as it is now. Supabase's Free plan has no automatic backups:

supabase db dump -f incident/schema.sql             # tables and policies
supabase db dump --data-only -f incident/data.sql   # keep this file private

Minutes 50 to 60: answer four questions

  1. What data? List the exposed columns. Emails and names are not the same event as passwords, payment details or ID photos.
  2. Whose, and how many? For a table:
select count(*) as rows_exposed, count(distinct user_id) as people
from public.invoices;
  1. Since when? Find the change that opened it:
git log --date=iso --format='%h %ad %s' -S 'invoices' -- supabase/migrations
  1. Did anyone other than the owner actually read it? Only logs can say. If the exposure is older than your log retention, write in your log that access cannot be ruled out. That is an honest answer, and the GDPR allows for it: information "may be provided in phases without undue further delay".

Who do you have to tell, and by when?

This is a summary of public texts, not legal advice. If you have EU or UK users, or users in many US states, a short call with a lawyer is worth it today.

  • EU (GDPR). A personal data breach includes "unauthorised disclosure of, or access to, personal data" (Article 4(12)). The controller notifies the supervisory authority "without undue delay and, where feasible, not later than 72 hours after having become aware of it", unless the breach "is unlikely to result in a risk" to people; a late notice must give "reasons for the delay" (Article 33). Users must be told "without undue delay" when the risk to them is high, with exceptions such as data protected by encryption (Article 34).
  • If you are the processor. A B2B app that stores its customers' data usually processes it for them. Then "The processor shall notify the controller without undue delay": tell your customer, who decides on notification.
  • UK. The ICO's page says you are "legally required to meet this timeframe and you should provide whatever relevant information you have"; its online form takes about 30 minutes and cannot be saved halfway (ICO). Its self-assessment takes about five minutes and helps decide whether to report.
  • US. Every state, plus DC, Puerto Rico and the Virgin Islands, has a breach notification law (NCSL summary). What triggers notice and how fast differs by state, so check the states where your users live.

What should the first message to users say?

The same things Article 33(3) asks you to tell a regulator: what happened, what data, the likely consequences, what you did, and who to contact. Sourcegraph's 2023 security update is a good model: it gave the time it revoked access and said plainly what was and was not exposed (Sourcegraph).

On [date] we learned that invoices in [app] could be viewed by other signed-in
users who changed the invoice number in the link. Invoices show [fields].
We closed this at [time] the same day. Our logs go back to [date]; [what they show].
You do not need to change your password. [Anything they should do.]
Questions: [email]. We will update this page by [date].

Do this today, before you need it

The developer of DrawAFish wrote after his incident: "Fortunately, I had set up firebase backups. Unfortunately, I had set them up wrong" (postmortem). Find out now, not during the hour:

  • Look up your plan's log retention for every service and decide whether it is long enough.
  • Write the list of secrets your app uses and where each one is rotated.
  • Save the lock-down SQL or rules above in your repository, so closing a table is one paste.
  • Restore a backup to a scratch project once.
  • On Firebase, decide whether to turn on Data Access audit logs for Firestore.

Where does Saqr fit?

Once the hole is closed, check that it stays closed and that it was the only one. A Saqr Quick check looks for exposed files, keys in the scripts your site sends and the backend settings the browser receives; a Full task, signed in with test logins you provide, tests tables readable without row level security and one user reaching another's records. After you fix something, ask "did my fixes work?" in Chat and it rechecks each finding on the live app. Your first check is free, no card needed.

Saqr (usesaqr.com) is AI security for web apps. Its AI agents attack your live app from the outside, the way a real attacker would, and show you exactly what to fix. From $19 a month, cancel any time. Tests only apps you have shown are yours.

Questions

Do I have to report a leak if nobody actually downloaded the data?

It depends on the law and the risk, so ask a lawyer for your case. The GDPR definition covers unauthorised disclosure of or access to personal data, and only breaches unlikely to result in a risk to people are exempt from notifying the authority. If your logs cannot show who read the data, you cannot claim nobody did.

Does the GDPR 72-hour clock start when the bug was introduced?

No. It starts when the controller becomes aware, which the EDPB describes as having a reasonable degree of certainty that a security incident has compromised personal data. A short investigation is allowed, but it should start immediately.

Should I delete the exposed data to be safe?

No. Close access to it instead. Deleting rows, tables, files or logs destroys the evidence you need to work out what happened and whom to tell, and it can lose your users' data.

Should I rewrite git history to remove a leaked key?

Rotate the key first; that is what makes it useless. GitHub's documentation says that once a secret is revoked or rotated, rewriting history to remove it may not be warranted.

My app is small. Does any of this apply to me?

The GDPR's breach articles contain no size threshold, and US state laws vary, so check the states where your users live instead of assuming a small team is exempt. The duties follow where your users are and what data leaked.