Vibe-Coded App Hacked? What to Do First
In short: When something in your app is exposed, the order matters. This is what I do when I find a gap at a client: close it right away, then check the logs, replace every key and document everything. Here are the steps for Lovable, Base44 and Supabase, how to spot an attack and what the GDPR requires.
By Michael Kaiser ·
What do you do when your app has a data breach?
You found a gap in your app, or someone pointed it out to you. Now the order matters most.
When I find a gap at a client, I always go about it the same way. So far, I have found every one before anyone exploited it. What can happen when nobody does that is in Vibe Coding Risks. But the steps apply just the same if you only suspect something or something has already happened:
- Close the gap right away
- Check the logs
- Replace every key
- Document everything
- If someone got in: check your duties under the GDPR
1. How do you close the gap right away?
The gap comes first, the search for traces after. Every minute it stays open is a minute someone can use it.
It is usually one of these causes: a table or data type has no rules, the rules let anyone do anything, a function doesn’t check sign-in, or a key sits in the code. How to find each of them is in Is Lovable safe? and Is Base44 safe?
What to tell your AI: “There is an open gap in my app: [describe it]. Close it now without changing anything else, and then show me exactly what you changed.”
If you can’t close the gap right away, take the app offline until it is closed:
- Lovable: In the project settings under Publishing, choose Unpublish project. The address is no longer reachable, and the project stays in the editor.
- Base44: Set the app’s visibility to private, so only invited people can get in.
2. What do the logs show?
Once the gap is closed, go through everything: the logs, the data and the keys. The question is: did anyone use the gap, and if so, when and for what?
- Supabase: Under Logs in the dashboard you can see, among other things, requests to the API, the database, sign-in and file storage.
- Base44: In the dashboard under Monitoring, you find the Logs tab. It shows, among other things, sign-ins, data access and function calls. You can filter by time range, for example the last 30 days, and by individual email addresses.
- Stripe: For every key, you can open its request logs in the dashboard and see what it was used for.
- Other services such as OpenAI: check how much was used recently and compare it with what your app needs.
Important: logs only go back so far. At Supabase, for the API and the database, it depends on your plan: one day on Free, 7 days on Pro, 28 on Team and 90 on Enterprise. So check the logs right away and save what you need. And if the gap was open longer than the logs go back, missing entries don’t prove that nobody was there.
How do you spot an attack?
These are the signs I see in logs when someone is probing an app:
- many failed sign-in attempts, often in quick succession
- strange requests to the backend, such as attempts to slip database commands in through input fields (SQL injection)
- a sudden burst of unusual traffic
- new accounts with odd names or addresses
If you see something like this, go through the steps here from the start.
3. Why do you replace every key?
I always replace exposed keys, even if the logs show no misuse. A key that was exposed once may have been copied, and it only stops working once you replace it at the provider.
- Supabase: Replace an exposed secret key as soon as you have fixed the cause. Note: new keys don’t invalidate the old legacy keys such as
service_role. You disable those in a separate step under Settings, API Keys. - Stripe: When you roll a key in the dashboard, you can keep the old one working for up to 7 days. For an exposed key, choose “Now” as the expiry, and the old one is deleted immediately.
- OpenAI: Replace the key right away on the API Keys page and put the new one into your app.
- GitHub: If a key was in your repo, removing it from the history is not enough. Copies can live on in forks and clones. That is why you replace it first.
4. What do you document?
Write down what happened while you still remember it exactly:
- when and how you found the gap
- what was open and since when
- what the logs show, including the time range
- what you changed and which keys you replaced
If the logs show no outside access, that’s where it ends for my clients. That assumes the logs cover the whole period during which the gap was open.
5. What does the GDPR require if someone got in?
If someone accessed personal data, such as names or email addresses, and your app falls under the GDPR, two articles matter:
- Art. 33 requires you to notify the competent supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware of it. The exception is a breach that is unlikely to result in a risk to the people affected. If you notify later, you have to give reasons for the delay. You have to document every breach, even if you don’t report it.
- Art. 34 requires you to also inform the people affected without undue delay if the breach is likely to result in a high risk to them.
This is not legal advice. In a real incident, ask your supervisory authority or a data protection lawyer, ideally on the first day, because the 72 hours run from the moment you become aware of it.
How do you prevent it next time?
Most gaps can be found before launch. The six checks for that are in the checklist before you launch. Run them after every major change to your app as well.
What to tell your AI: “Check every table and every function. Without signing in, nobody sees data, every person sees only their own, and no key sits in the code the browser loads. List everything that deviates from this.”
Can this be handled while you build?
The steps above start once something has already been exposed. builtSecure starts earlier. It gives your AI the rules while it builds: data starts private, every function checks sign-in first, and keys go into protected storage. And it asks you what only you can know, such as who may see which data.
builtSecure is still at an early stage. If you want to try it, you can start for free below.
Frequently asked questions
Should I take my app offline?
If you can't close the gap right away, yes. In Lovable you unpublish it, and the project stays in place. In Base44 you set the app's visibility to private.
Is it enough to delete the key from the code?
No. The old key keeps working until you replace or revoke it at the provider. That also applies if it was only in the code or your repo's history for a short time.
Do I have to report every data breach?
Not every one. Under Art. 33 GDPR, you don't have to notify if the breach is unlikely to result in a risk to the people affected. You still have to document it. When in doubt, get advice.
Sources
- Lovable: Publish your Lovable project, retrieved on
- Base44 security: An overview, retrieved on
- Base44: Monitoring your app with alerts and logs, retrieved on
- Supabase: Logs in Studio, retrieved on
- Supabase: API keys, retrieved on
- Stripe: API keys, retrieved on
- OpenAI: Best practices for API key safety, retrieved on
- GitHub: Removing sensitive data from a repository, retrieved on
- Art. 33 GDPR: Notification of a personal data breach to the supervisory authority, retrieved on
- Art. 34 GDPR: Communication of a personal data breach to the data subject, retrieved on
Security you never have to ask for. Free during early access.
Start for freeRather get news first? Subscribe and we'll email you now and then.