Security10 min read

What Does a Security Audit of a Vibe-Coded App Actually Cover?

A vibe-coded app security audit covers auth flows, RLS policies, API routes, and AI features. Here's what a manual review checks and what automated tools miss.

A security audit of a vibe-coded app is not the same as running a linter or scanning your repository with an automated tool. The vulnerabilities that show up most often in AI-generated codebases — silent authorization gaps, misconfigured Row Level Security policies, API routes that check identity but not permission, AI features that accept unvalidated user input — are all logic errors that static analysis either misses entirely or buries in noise. The most common critical finding across the 24 published vibe-coded app audits in 2026 was not an injectable SQL query or a missing security header. It was a Supabase table with RLS policies that looked correct but allowed any authenticated user to read every row. Automated tools flagged none of them. A manual security audit for vibe-coded apps found all of them.

This post explains exactly what a security audit of a vibe-coded app covers, broken down by area. If you are preparing for an audit, evaluating whether you need one, or trying to understand what a security firm actually does when they review a Lovable, Bolt, Cursor, v0, or Replit app, this is the reference you have been missing. We cover authentication and session handling, database access control, API route authorization, AI feature security, secret exposure, dependency risk, and what happens after the findings are delivered.

Why Automated Scanning Is Not Enough for Vibe-Coded Apps

Tools like DeployReady, Semgrep, CodeQL, and npm audit are genuinely useful. Run DeployReady before any audit — it catches environment variable patterns, known vulnerable packages, missing security headers, and exposed secrets in seconds and costs nothing. What it cannot catch is authorization logic that is structurally correct but semantically wrong. When an AI tool generates a Supabase query that filters by user ID in the application layer but does not enforce a corresponding RLS policy at the database layer, the code looks fine in a static scan. The filter runs. The app works. And any user who makes a direct API call to the Supabase REST endpoint bypasses the application-layer filter entirely.

  • →Automated scanners check syntax and known vulnerability signatures. They do not understand the relationship between your database schema, your RLS policies, your API routes, and your business logic. That relationship is where vibe-coded app vulnerabilities live.
  • →AI coding tools generate authorization checks inside application code — a common pattern is filtering database queries by the authenticated user's ID in the Next.js route handler. This passes every linter check. It fails under direct API access, because the database itself does not enforce the same constraint.
  • →Security headers, CSP, and dependency CVEs are scannable and are not where vibe-coded apps fail audits. Access control, data isolation, and AI feature input validation are where they fail — and those require a human reviewer reading the code with an adversarial mindset.
  • →The Cloud Security Alliance's 2026 research found that less than 30% of vibe-coded app teams ran any manual security review before their first real-user launch. The same research found that 91.5% of tested apps had at least one exploitable vulnerability. The overlap is not a coincidence.

Authentication and Session Security

Authentication review is the first area in any vibe-coded app audit because authentication mistakes in AI-built apps are the most common path to full account compromise. The audit goes beyond whether login works. It examines whether the session token is correctly scoped, whether protected routes enforce session checks on the server rather than just hiding UI elements on the client, whether password reset flows are resistant to account takeover, and whether multi-tenant apps prevent session tokens from one tenant from being used against another tenant's resources.

  • →Session token scope: a reviewer checks whether the session token created at login carries the user's tenant ID and role in a form the server enforces on every request — not just at the middleware level, but all the way down to the database query.
  • →Server-side route protection: in Next.js and similar frameworks, route protection is commonly added in middleware. A reviewer tests whether a request that bypasses middleware — for example, a direct call to an API route — still returns a 401 for unauthenticated sessions. It frequently does not.
  • →Password reset flows: AI-generated password reset flows often generate a reset token and store it in the database, but fail to invalidate existing sessions when the password is changed. An attacker who has an active session can retain access even after the legitimate user resets their credentials.
  • →Magic link and OAuth handling: magic links with long expiry windows and OAuth callback handlers that do not validate the state parameter are common in AI-scaffolded apps. Both are exploitable under a phishing or session fixation attack.
  • →Logout completeness: the audit verifies that logout invalidates the session on the server, not just in the client's local storage. A logout that only clears a cookie client-side leaves the server-side session active and reusable from any other device or context where the token was copied.

Database Access Control and Row Level Security

Database access control is the highest-severity area in Supabase and Firebase app audits. The audit reviews every table's Supabase RLS policies and Firebase security rules for three types of failures: missing policies (a table with RLS disabled is readable and writable by any authenticated user via the Supabase REST API), policies that are enabled but universally permissive (a SELECT policy of `using (true)` is equivalent to no policy at all), and policies that check identity but not ownership (a policy that checks `auth.uid() is not null` confirms the user is logged in but does not confirm they own the row they are querying).

  • →RLS coverage audit: a reviewer reads the schema and checks which tables have RLS enabled. Any table storing user data, payment data, tenant configuration, or AI conversation history with RLS disabled is a critical finding. In one set of 24 published audits, 16 of them included at least one table in this state.
  • →Policy correctness review: for each table with RLS enabled, a reviewer reads the SELECT, INSERT, UPDATE, and DELETE policies and tests whether they enforce ownership correctly. The most common error is a SELECT policy that returns rows where the authenticated user's ID matches a user_id column, but an INSERT policy that does not enforce the same constraint — allowing a user to insert a row with an arbitrary user_id.
  • →Storage bucket ACLs: Supabase storage bucket policies are reviewed separately from table RLS. AI tools frequently create public buckets for user-uploaded content, leaving every file readable by any URL without authentication. For profile photos this is often intentional; for documents, contracts, or financial records it is never acceptable.
  • →Service role key exposure: a reviewer checks whether the Supabase service role key — which bypasses RLS entirely — appears anywhere in client-side code, environment variable files committed to the repository, or build artifacts. This key should exist only in server-side environment variables and must never be shipped to the browser.
  • →Firebase rule review: for apps using Firebase, the equivalent review checks Firestore security rules and Firebase Storage rules for `allow read, write: if true;` entries and rules that check authentication but not ownership. Firebase's default rules during development are universally open, and AI tools sometimes leave those defaults in place for production.

API Route Authorization

Authorization at the API route level is distinct from authentication. Authentication confirms who is making the request. Authorization confirms whether that user is permitted to perform the specific operation they are requesting — and in AI-generated apps, the authorization check is often missing entirely or checked at a level the attacker can bypass. A reviewer tests every API route with requests from users who should not have access: a different tenant's authenticated user, an authenticated user with a lower-privileged role, and an unauthenticated request.

  • →IDOR testing: Insecure Direct Object Reference vulnerabilities are the most common API authorization failure in vibe-coded apps. The reviewer logs in as User A, copies the resource ID of a resource belonging to User B, and makes a request to the API route for that resource as User A. If the route returns or modifies User B's resource, it is an IDOR vulnerability. This test takes seconds and fails consistently in AI-generated codebases that check authentication but not ownership.
  • →Role enforcement testing: for apps with admin routes, the reviewer tests whether admin-only routes enforce the role check on the server. AI tools frequently add UI-level gating — hiding the admin button for non-admin users — without adding a corresponding role check in the API route handler. The route is still accessible via direct HTTP request.
  • →Cascading operations: AI-generated bulk operations — delete all records for a user, export a user's data — often check that the requesting user is authenticated but do not verify that the records being deleted or exported belong to that user. A reviewer submits a delete or export request with IDs belonging to a different user to confirm the ownership check is enforced.
  • →Webhook security: payment webhook handlers are reviewed for signature verification. An API route that processes a Stripe or other payment webhook without verifying the request signature can be triggered by any external caller, potentially creating fraudulent subscriptions, refunds, or access grants.

AI Feature Security: Prompt Injection, Tool Calls, and Data Exfiltration

Apps that include an AI chatbot, a document summarizer, or any feature that passes user-provided content to an LLM require a separate AI security review. The attack surface is different from traditional web app vulnerabilities. The primary risks are prompt injection — where user-supplied content manipulates the AI into ignoring its system prompt or performing unauthorized actions — and data exfiltration through tool calls — where an AI with access to user data or external APIs can be manipulated into leaking information from one user to another.

  • →Prompt injection testing: a reviewer submits requests designed to override the system prompt, bypass content filters, and extract instructions the AI was given. In a multi-tenant app where the AI has access to data from multiple tenants, a successful injection may allow one tenant to query another tenant's data through the AI interface.
  • →Tool call authorization: if the AI is given tools that read or write data — a database query tool, an email sending tool, an API calling tool — a reviewer checks whether each tool enforces the same ownership and permission rules as the equivalent direct API call. Tools frequently inherit the application's service role credentials rather than the requesting user's session credentials, giving the AI elevated access that can be exploited through injection.
  • →Context window data isolation: in multi-tenant apps, a reviewer checks whether the AI's context window is strictly scoped to the requesting user's data. If the system prompt includes records from multiple users to provide context, a prompt injection attack may be able to extract those records.
  • →Output handling: AI output that is rendered in the browser without encoding is an XSS vector. If the AI can be prompted to output HTML or JavaScript, and that output is inserted into the DOM without sanitization, an attacker can inject scripts into another user's session through a shared AI response.

Secret and Credential Exposure

Secret exposure is the most immediately exploitable finding in a vibe-coded app audit. A reviewer scans the repository's full git history, the production build artifacts, and the client-side JavaScript bundle for API keys, service credentials, and database connection strings. The full git history matters because API keys exposed in vibe-coded apps are often added in an early commit and removed in a later one — the removal fixes the visible file but leaves the credential in the history, where any clone of the repository exposes it.

  • →Git history scan: a reviewer runs secret scanning across the full commit history, not just the current HEAD. Any credential that ever appeared in a committed file must be treated as compromised and rotated, even if it was removed in a subsequent commit.
  • →Build artifact inspection: Next.js and similar frameworks embed parts of the environment at build time. A reviewer inspects the compiled JavaScript bundle for NEXT_PUBLIC_ prefixed environment variables and checks whether any of those contain sensitive values. Keys intended for server-side use should never appear in a NEXT_PUBLIC_ variable.
  • →Client-side bundle analysis: a reviewer loads the production app and searches the browser's Sources tab for credential patterns — strings that match the format of API keys for common services like Stripe, OpenAI, Supabase, and AWS. AI coding tools occasionally move a secret from an environment variable into a configuration object without preserving the server-only constraint.
  • →Service account scope: for service accounts and machine credentials, a reviewer checks the minimum required permissions rather than just confirming the key is not publicly exposed. A Supabase service role key with no row-level filtering and full schema access is a larger blast radius than a scoped key, even if the exposure path is identical.

Dependency and Supply Chain Review

Dependency review covers known vulnerabilities in installed packages and the structural conditions that make vibe-coded apps susceptible to supply chain attacks. This area has become a higher priority since the npm supply chain attacks that targeted vibe-coded apps in March 2026. A reviewer runs npm audit, inspects the lockfile for absent or uncommitted state, and checks whether the CI pipeline uses npm ci or npm install — a distinction that determines whether the build is reproducible and whether a compromised package can be introduced silently between builds.

  • →npm audit: the reviewer runs npm audit and reviews every high and critical CVE in the installed package tree. AI tools add packages without auditing them, so vibe-coded apps frequently carry transitive dependencies with known vulnerability scores that were never reviewed.
  • →Lockfile status: a committed package-lock.json or pnpm-lock.yaml is a prerequisite for reproducible builds. A project without a committed lockfile installs whatever the registry serves on the next build. The reviewer checks whether the lockfile is committed and whether the CI pipeline enforces its integrity.
  • →Package metadata review: for packages added by AI tools that the developer did not explicitly select, a reviewer checks the package's download count, maintainer history, and publish date on npmjs.com. A package added by an AI suggestion that has low download counts, a recent transfer of ownership, or a version published hours before the last build is flagged for manual investigation.
  • →Install script inspection: the reviewer checks whether any installed package runs a postinstall or preinstall script, and reads those scripts. Lifecycle scripts with network access or file system writes in a production dependency require explicit justification.

What Happens After the Audit?

An audit that delivers a list of findings without a path to resolution is not useful. A complete security audit includes a written report with each finding categorized by severity (critical, high, medium, low), a clear description of the vulnerable code and the attack vector it enables, a concrete remediation recommendation, and a timeline estimate for the fix. Critical and high findings — authentication gaps, missing RLS policies, exposed service role keys — are expected to be remediated before the app handles real user data. After remediation, a retest confirms the fix closed the finding rather than moving it.

  • →Severity triage: not every finding requires the same urgency. A critical finding like a table with RLS disabled on a production Supabase instance is a same-day fix. A medium finding like a missing Referrer-Policy header is a valid backlog item. The audit report should make this distinction clearly so the development team can prioritize without slowing their roadmap.
  • →Remediation support: the most useful audit engagements include access to the security reviewer during the fix period. The reviewer can confirm whether a proposed fix closes the finding, suggest the most idiomatic implementation for the specific framework the app uses, and help avoid introducing a new vulnerability while fixing the original one.
  • →Retest: after the team applies fixes, a retest verifies that each critical and high finding is closed. A retest is not a full re-audit — it retests the specific findings from the original report. Any finding that was not fully fixed or was partially fixed is noted in the retest report.
  • →Ongoing posture: a one-time audit reflects the security posture of the app at a point in time. As new features are added, new vulnerabilities can be introduced. Teams that ship regularly should consider a lightweight ongoing review or a re-audit before significant milestones like a funding round, an enterprise customer contract, or a security questionnaire.

Frequently Asked Questions

What does a security audit of a vibe-coded app cover?

A security audit of a vibe-coded app covers authentication and session handling, database access control and RLS policies, API route authorization, AI feature security (prompt injection and tool call permissions), secret and credential exposure in the codebase and git history, and dependency vulnerabilities. The audit includes both static code review and live testing against a running instance of the app. The findings are delivered as a written report with severity ratings and remediation recommendations.

Do I need a security audit before launching a vibe-coded app?

If your app stores any user data, processes payments, or handles information that belongs to one user and should not be visible to another, yes. The authorization and access control vulnerabilities that show up consistently in AI-generated codebases are exploitable by any user with a browser and basic knowledge of how HTTP requests work. Run DeployReady first to clear the automated checks, then get a manual review before you have real users whose data can be compromised.

How is a manual security audit different from an automated scan?

Automated scanners check syntax, known CVE patterns, missing security headers, and secret exposure in current files. Manual review checks logic: whether the authorization model you implemented actually prevents one user from accessing another user's data, whether your AI feature can be manipulated into leaking information, whether your RLS policies are semantically correct (not just enabled), and whether your API routes enforce the same constraints as your database policies. The critical findings in vibe-coded app audits are almost always logic errors that automated tools cannot detect.

How long does a security audit of a vibe-coded app take?

A focused audit of a vibe-coded app — a single-tenant product with a Supabase or Firebase backend, a Next.js frontend, and standard auth — typically takes three to five business days for the first-pass review and report. Apps with multi-tenant architectures, AI features with tool access, or complex payment flows take longer. The retest after fixes takes one to two days. Total engagement from kick-off to closed findings is typically one to two weeks.

What are the most common critical findings in vibe-coded app security audits?

The most common critical findings are: Supabase tables with RLS disabled or universally permissive policies, API routes that check authentication but not ownership (enabling IDOR attacks), Supabase service role keys exposed in client-side code or build artifacts, and prompt injection vulnerabilities in AI chatbot features that have tool access to user data. Missing lockfiles and npm packages with known critical CVEs are common high-severity findings. Missing security headers and CORS misconfigurations are common medium findings.

How Belsoft Helps You Audit Your Vibe-Coded App

Belsoft's security audit for vibe-coded apps is a manual review by engineers who know how Lovable, Bolt, Cursor, v0, Replit, and Windsurf generate code and where the patterns they produce break down. The audit covers every area described in this post: authentication and session handling, RLS and database access control, API route authorization, AI feature security, secret exposure in the codebase and git history, and dependency risk. We deliver a written report with severity ratings, the specific vulnerable code, the attack vector it enables, and a concrete remediation recommendation for each finding. We stay available during your fix period and run a full retest once you have applied the critical and high fixes. Start by running DeployReady — it handles the automated baseline in seconds. When you are ready for the manual review, book a call with the Belsoft security team and we will scope the engagement to your app's architecture and timeline.

If you shipped with an AI coding tool and have not had a manual security review, the question is not whether your app has exploitable vulnerabilities — the data is unambiguous on that. The question is whether you find them before your users do. Belsoft's security audit service is built specifically for this: not a generic pentest checklist, but a review that understands the specific failure patterns of AI-generated codebases and tests for them systematically.

“The critical findings in vibe-coded app audits are logic errors, not syntax errors. Automated tools miss them because they can read code — they cannot understand authorization intent.”

Written by

Marco Silva

Security Engineer, Belsoft Solutions

Ready to partner?

Let's talk about your company.

30 minutes. No pitch. We talk through how you run today and where AI and automation would help.

Book a free audit
logo

Your AI & automation transformation partner: we audit, build, and train your team, then stay embedded as you grow.

Member ofNVIDIA Inception Program

Copyright Ⓒ 2026 BelSoft. All Rights Reserved.

BELSOFT, LDA · NIPC 517893258 · Lisbon, Portugal