Back to the blog

Securing a vibe-coded app: 7 mistakes to fix before you publish

Code5 min read · 27 September 2026

The GetPack team

Your app works. The form saves, the page displays, the button exports. That doesn’t mean it’s safe. An AI coding tool answers exactly what you asked for, not “make sure no one else can read other users’ data” if you never actually said so. Here are the seven mistakes that show up most often in vibe-coded apps, and the fix for each one.

Why this can’t wait

In late September 2026, an investigation found around 16,000 Supabase databases leaking personal data (names, addresses, passwords) because of misconfigured applications. A few months earlier, a researcher had already documented CVE-2025-48757: more than 170 applications built with the Lovable tool exposed their entire database to anyone, without even logging in, because of a single missing setting. These aren’t isolated cases: they’re configuration mistakes that keep recurring, because the same AI tools scaffold projects the same way every time.

These seven families of flaws are common enough that they map, one by one, to categories in the OWASP Top 10:2025, the world’s reference list of web security risks, updated in 2025 with two new categories, one of them dedicated specifically to software dependencies.

Why a student project is just as exposed as a startup

You might think these seven mistakes mostly matter to companies handling thousands of customers. In practice, a student project often checks every box that exposes it: a public GitHub repository to show off your work in a portfolio, a link shared widely on a school Discord or a class group chat, a demo shown off at a hackathon. None of that is a problem by itself, but it means your project can be viewed, tested, and sometimes attacked by far more people than the handful of classmates you had in mind when you published it. The fixes below don’t require any more skill than the rest of the project; they just require handling them before you share the link, not after.

The 7 mistakes, and how to fix each one

1. A secret API key exposed in the browser. A key meant to stay secret (database, paid service, AI provider) ends up written in plain text inside the JavaScript sent to the browser. Anyone can pull it out in three clicks using the browser’s developer tools. Fix: a secret key should never leave your server. Always distinguish a public key (“anon” or “publishable,” meant to be visible) from a secret key (“service_role” or “secret,” which must stay server-side only, inside a backend function).

2. A committed .env file. The file holding your keys travels with the rest of your code on the first git push, often to a public repository. GitGuardian’s 2025 State of Secrets Sprawl report counted more than 23.8 million new secrets exposed on public GitHub in 2024, a 25% increase over the year before. Fix: add .env to your .gitignore before your first commit, not after. If a secret has already been pushed, treat it as compromised and regenerate it; removing it from history isn’t enough, you have to rotate it.

3. A database with no Row Level Security (RLS). On Supabase (the database most vibe-coding tools default to), the official documentation is blunt: “a table in an exposed schema without RLS is readable and writable by any role with a grant on it.” That’s exactly the root cause of CVE-2025-48757: Supabase disables RLS by default on every new table, and the code these tools generate never turned it on. Fix: enable RLS on every table (alter table my_table enable row level security;) and write one policy per operation, for example so a user only ever sees their own rows:

create policy "Everyone sees only their own data"
on my_table for select
to authenticated
using ( (select auth.uid()) = user_id );

4. Homemade authentication. Writing your own password handling, sessions, or tokens from scratch instead of using a proven system. This falls under the “Authentication Failures” category of the OWASP Top 10:2025. Fix: use the authentication system your platform already provides (Supabase Auth or equivalent) instead of inventing your own. Rolling your own is almost never faster, and it’s far riskier.

5. No input validation. Trusting whatever a form or API request sends, without ever checking its format, size, or content. This is the “Injection” category of the OWASP Top 10:2025, historically one of the most exploited. Fix: validate and sanitize every input on the server side (not just in the browser, which can be bypassed), and use parameterized queries instead of building SQL by string concatenation.

6. Wide-open CORS. An API configured to answer any website (Access-Control-Allow-Origin: *), which lets a malicious site call your API on behalf of a logged-in user. This is a textbook example of the “Security Misconfiguration” category in the OWASP Top 10:2025. Fix: explicitly allow a precise list of trusted domains, and never reflect the visitor’s Origin header straight back in your response.

7. Vulnerable dependencies. Installing packages without ever checking whether they carry known vulnerabilities. The OWASP Top 10:2025 created a dedicated category for this, “Software Supply Chain Failures,” expanding the old 2021 “vulnerable and outdated components” category, a sign the topic is now considered even more critical than before. Fix: run npm audit (or your language’s equivalent), which, per npm’s official documentation, “submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities.” Keep a lockfile (package-lock.json) and update regularly.

A pre-publish checklist

Before you share your project’s link, check, in order:

  • No secret key appears in the code sent to the browser (inspect the source your browser actually shows, not just your own files).
  • .env is in .gitignore, and no secret is sitting in your Git history.
  • RLS is enabled on every table in your database, with at least one tested policy.
  • You’re using an existing authentication system, not your own.
  • Every form and every API route validates its input server-side.
  • Your API only allows the domains you actually need.
  • npm audit (or equivalent) shows no unfixed critical vulnerability.
  • No secret shows up anywhere in your repository’s Git history, even in an old commit you think you’ve since “fixed.”
  • You’ve tested the app with a second account to confirm it never sees the first account’s data.

Key takeaways

  • An app that “works” on screen can still be exposing every user’s data: the visual test isn’t enough.
  • The seven most common mistakes each map to a recognized category in the OWASP Top 10:2025.
  • The most documented flaw in vibe-coding tools is missing Row Level Security on Supabase: turn it on for every single table, systematically.
  • A secret key that was committed or shipped to the browser needs to be regenerated, not just deleted.
  • If your project handles real personal data, even a classmate’s, treat it with the same seriousness as a professional one.

For a guided check of these seven points on your own project, the securite-app-vibe skill walks through this checklist step by step.

Sources

  1. OWASP Top 10:2025 — OWASP Foundation · accessed 27 September 2026
  2. Row Level Security — Supabase Docs · accessed 27 September 2026
  3. The State of Secrets Sprawl 2025 — GitGuardian · accessed 27 September 2026
  4. CVE-2025-48757 — Matt Palmer · accessed 27 September 2026
  5. NPM Security Cheat Sheet — OWASP Cheat Sheet Series · accessed 27 September 2026
  6. Some Supabase customers are publicly exposing reams of people's data to the web — TechCrunch · accessed 27 September 2026

Read the next article

Code27 September 2026

Slopsquatting: when AI recommends packages that don't exist

Weekly brief27 September 2026

AI news roundup: the week of September 21–27, 2026

Code27 September 2026

Vibe coding: what it actually means (and how not to mess it up)

AI news27 September 2026

Why Yann LeCun wants AMI: AI beyond LLMs

Tutorial26 September 2026

Connect an MCP connector to Claude without writing a line of code

Degrees26 September 2026

Choosing your program with real MonMaster and InserSup data

Method26 September 2026

APA 7, ISO 690, Vancouver: how to cite your sources properly

Explainer26 September 2026

ChatGPT's 'hidden codes' on TikTok: fact vs. fiction

Health26 September 2026

Medicine: revise for the EDN with France's public drug database

Career26 September 2026

Internship pay and apprentice wages in 2026: the rules

Explainer26 September 2026

AI and academic integrity: what universities actually say

Tutorial26 September 2026

Installing a skill in Claude in 2 minutes

Thesis26 September 2026

Thesis: building your research question and outline with AI

Method26 September 2026

Building your exam study schedule with AI, the right way

Method26 September 2026

Revising with AI, honestly: active recall, Feynman, quizzes

Career26 September 2026

Choosing your apprenticeship with real employment data

Code27 September 2026

Learning to code in the age of AI: what you still need to know how to do yourself

Code27 September 2026

The one-page spec to write before you prompt an AI to code

Thesis27 September 2026

How to cite ChatGPT or Claude in a thesis: APA, MLA, ISO 690

Code27 September 2026

Claude Code for beginners: install, first launch, CLAUDE.md

AI news27 September 2026

Claude Opus 5.5: what really changes (and how to use it to study)

Analysis27 September 2026

The AI race: why some people are scared and others aren't

Code27 September 2026

Building your first MCP server, step by step

Code27 September 2026

Deploying your first site for free: Vercel, Netlify, Cloudflare Pages, or GitHub Pages

Explainer27 September 2026

AI detectors: are Turnitin, GPTZero and Compilatio reliable?

Code27 September 2026

Writing your own Claude skill: structure, SKILL.md, and a description that triggers

Career27 September 2026

France's national student-entrepreneur status (SNEE) and the PEPITE network, explained

Analysis27 September 2026

France in the AI race: Mistral, energy and talent

AI news27 September 2026

French Tech and AI: the French startups to know in 2026

Code27 September 2026

Git without fear: commit, branch, remote explained, then the commands that save you

Explainer27 September 2026

Chinese AI: DeepSeek, Qwen, Kimi… why Europe is wary

Health27 September 2026

AI in medical school: study for PASS, LAS and the EDN safely

Tools27 September 2026

Free AI for students: every offer and discount (2026)

Career27 September 2026

AI on an internship or apprenticeship: what’s allowed, what isn’t

Code27 September 2026

From IDE to ADE: coding with AI agents in 2026

Code27 September 2026

Reading an error without panicking: the anatomy of a stack trace (Python and JavaScript)

Tools27 September 2026

Best AI for students in 2026: the honest comparison

Tools27 September 2026

New AI models in 2026: which one should you study with?

Tools27 September 2026

French AI tools you’ve never heard of: Noota, Moshi, Vibe…

Analysis27 September 2026

Why AI is so expensive (and American AI even more so)

Code27 September 2026

How to prompt an AI coding tool well: the method that changes everything

Join GetPack

Already have an account? Sign in