Sample alert How it works Coverage PENTEST METHODOLOGY DOCS PRICING FAQ MCP CONTACT LOG IN SCAN MY APP →

Lovable Leaked Password Protection: Turn It On in Supabase

Lovable apps use Supabase auth. Supabase can block passwords that appear in known breach corpora - but it's off by default. Here's the 2-minute fix.

Seeing a rejected password rather than configuring protection? Read how to fix the Supabase weak-password error.

What Changes for Lovable Apps

Lovable’s default Supabase auth ships without leaked-password protection. A user can sign up with password123, qwerty, or a password reused from a breached service. Attackers replay credentials from public dumps instead of guessing.

Lovable gets auth working in the preview: the Supabase project is created, the email provider is on, and the AI wires signUp / signInWithPassword. The toggles that live only in the Supabase dashboard (leaked passwords, minimum length, confirm email) get skipped because the generated UI never mentions them. This page covers that step.

What credential stuffing looks like

Credential stuffing is a botnet running through a CSV:

  1. The attacker downloads or buys a “combo list” of email:password pairs scraped from earlier breaches (LinkedIn 2012, Adobe 2013, Collection #1, RockYou2024).
  2. The botnet hits your /auth/v1/token endpoint from rotating IPs at low volume per IP.
  3. Every user who reused a leaked password is compromised.
  4. Compromised accounts are sold or used directly for fraud.

Stronger password rules don’t help, because users still reuse. The fix is to refuse passwords that are already in the lists. HaveIBeenPwned’s k-anonymity API does that, and Supabase’s leaked-password setting wires it up for you.

Stuffing is worse when RLS is also weak. A stuffed account that can select * every row through a bad policy is a full data breach. Enable leaked-password protection and still run the Supabase RLS Checker.

The Fix

  1. Open the Supabase dashboard for your Lovable project
  2. Navigate to Authentication → Policies (or Providers → Email)
  3. Find “Password policy” or “Leaked password protection”
  4. Toggle Enable leaked password protection on
  5. Save
  6. (Optional) Set minimum password length (recommend 10+)

Every new signup and password change is now checked against HaveIBeenPwned at the API level.

If you manage Auth via config as code, also confirm the project you edited is the same project URL embedded in your Lovable app (VITE_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_URL). Editing a leftover dev project leaves production unprotected.

How the check actually works (k-anonymity)

Supabase doesn’t send the password to HaveIBeenPwned:

  1. User submits a password at signup.
  2. Supabase computes the SHA-1 of the password locally.
  3. Supabase sends only the first 5 hex characters of the hash to HIBP’s range API: GET https://api.pwnedpasswords.com/range/<5chars>.
  4. HIBP returns ~500–1000 hash suffixes that share that prefix.
  5. Supabase checks locally whether the full hash is in the list. If yes, signup is rejected.

HIBP never sees the password or the full hash. The password goes only to your auth backend, as in any signup.

You do not need to call HIBP from your Lovable frontend. Client-side HIBP checks are optional UX. The dashboard toggle can’t be bypassed by skipping your React form.

What Happens at Signup

CLEAN PASSWORD

Accepted. User proceeds through signup normally.

LEAKED PASSWORD

Rejected with clear error: "Password found in known breach. Choose another."

WEAK BUT UNLEAKED

Accepted if it meets min length - length + leak check is the policy.

API ERROR

Signup fails safe. User sees retry prompt.

Verify the setting from the client

After enabling, confirm by attempting a signup with a known-leaked password (use password123 or qwerty):

import { createClient } from '@supabase/supabase-js';

const supabase = createClient(URL, ANON_KEY);

const { data, error } = await supabase.auth.signUp({
  email: 'test+pwned@example.com',
  password: 'password123',
});

console.log({ data, error });
// Expected: error.message includes "Password is known to be weak and easy to guess"

If the call succeeds, the toggle didn’t save (or you’re hitting a stale Supabase client). Re-check the dashboard and refresh.

Also test password change flows if your app has them:

const { error } = await supabase.auth.updateUser({ password: 'password123' });
// Expect failure once leaked-password protection is on

Custom error UX

Catch the default Supabase error and rewrite it for your users:

const { error } = await supabase.auth.signUp({ email, password });

if (error?.message?.toLowerCase().includes('weak')) {
  showError(
    'That password has appeared in known data breaches and isn\'t safe to reuse. ' +
    'Try a unique password - a password manager helps.'
  );
  return;
}

Users who hit this are often confused because the password “worked everywhere else.” Lovable-generated UIs often show the raw API string in the error toast, so prompt the generator (or edit once) to map auth errors to friendly copy.

Pair With These Other Settings

Add these alongside the leaked-password check:

  • Minimum password length: 10+ characters. Skip the “1 uppercase + 1 number + 1 symbol” rules.
  • Require email verification: prevents bot signups and limits credential-stuffing damage to verified addresses.
  • Rate limits on signup and password-reset: 5/minute/IP at the Edge Function or proxy layer. Supabase’s built-in limits are loose by default.
  • Rate limits on /auth/v1/token: the actual login endpoint - credential stuffing hits this, not signup. Add a Cloudflare rule or Edge Function in front.
  • Passkeys or OTP: offer passwordless alongside password. Passkey users can’t be credential-stuffed.
  • MFA / TOTP: for higher-value accounts (admin, paid tier). Even a leaked password fails without the second factor.
  • Anomaly notification: email the user on first login from a new device/IP. This doesn’t prevent compromise but shortens how long it goes unnoticed.
  • Session lifetime: shorter refresh windows for apps with sensitive data; force re-auth for billing changes.

Cloudflare / edge sketch for token rate limits

# Conceptual - implement as WAF rate rule on
# POST https://<project>.supabase.co/auth/v1/token*
# e.g. 10 requests / minute / IP for grant_type=password

Without a rate limit in front, stuffing still finds common passwords (Summer2024!) that HIBP has not labeled.

What this guide does NOT cover

  • Migrating existing weak passwords. Supabase only checks new passwords and password changes. Existing users keep their old passwords, and you can’t detect weak ones without re-checking on login. Send a one-time “we updated our password policy, please reset” email.
  • Server-side credential stuffing detection. Attackers still try common passwords that are not in the leak list. Detect failed-login spikes and IP velocity with a log pipeline (Logflare, Datadog) and an alert rule. Supabase doesn’t ship this.
  • OAuth / social-login accounts. Users who signed in with Google/GitHub never set a password in your system. Their security depends on the provider’s policies, not yours.
  • Account-recovery social engineering. Abuse of “I forgot my password” flows is a separate hardening pass.
  • Lovable share password. The preview gate is unrelated; see the comparison table below.

Site password vs account password (do not confuse them)

Control What it does What it does not do
Lovable / host share password Blocks casual visitors from a preview URL Does not secure APIs, RLS, or production users
Supabase leaked password protection Blocks breached passwords at signup/change Does not fix missing RLS or open tables
Strong session + MFA Hardens logged-in accounts Does not stop anon key table dumps

Attackers who only curl PostgREST ignore the Lovable share password entirely. Enable leaked-password protection for real user accounts, then run RLS and key scans.

Password reset and invite flows

Lovable apps often generate “forgot password” and invite links via Supabase. Review:

  • Reset links expire (do not lengthen the Supabase default to weeks).
  • Reset pages do not reflect tokens into analytics query strings.
  • After reset, the new password is subject to leaked-password rules (good - confirm with a test).
  • Invite flows do not pre-create accounts with a shared temporary password in the Lovable chat history or email template.
  • Redirect URLs for recovery are allowlisted in Supabase Auth URL config so open redirects cannot steal tokens.
// Recovery should land on your domain only
await supabase.auth.resetPasswordForEmail(email, {
  redirectTo: 'https://yourapp.com/reset-password',
});

How to verify end-to-end

  1. Toggle leaked password protection in Supabase Auth settings; save.
  2. From the Lovable app (or a minimal script), signUp with password123 → expect failure.
  3. signUp with a long unique password → expect success (or email confirmation pending).
  4. Confirm min length ≥ 10 in the same policy panel.
  5. Confirm email confirmation required for production.
  6. Hit /auth/v1/token with repeated failures from one IP - add rate limiting if unlimited.
  7. Run Vibe Code Scanner - auth is only one surface.
  8. Run Supabase RLS Checker - password policy does not hide open tables.

Common mistakes on Lovable + Supabase auth

  • Enabling the toggle in a dev Supabase project but shipping a different prod project.
  • Relying on client-side password strength meters only (trivial to bypass).
  • Leaving Confirm email off so stuffed accounts are immediately usable.
  • Assuming OAuth users are “safe” while password users remain on Password1! forever with no reset campaign.
  • Shipping admin accounts with shared passwords in the Lovable prompt history.
  • Disabling leaked-password protection after one user complains. Improve the error UX instead.
  • Testing only in the Lovable preview while production points at another Supabase ref.

Rollout for existing user bases

  1. Enable leaked-password protection + min length for all new passwords.
  2. Announce a password refresh; force reset on next login for accounts older than the policy change if you can flag them.
  3. Offer passkeys/MFA for high-value roles.
  4. Monitor failed logins per IP; block or CAPTCHA after threshold.
  5. Keep RLS and service_role hygiene on the same launch checklist - a stuffed account that can read everyone’s rows via bad RLS is far worse than one that is well scoped.

Run a full VibeEval scan after enabling to verify auth coverage.

Common questions

What is leaked password protection?
Supabase checks new passwords against the HaveIBeenPwned database of breached credentials. If a user tries to sign up (or change password) using a known-leaked password, the signup is blocked with a clear error.
Does enabling this break existing users?
No. It only checks passwords on *new* signups and *new* password changes. Existing passwords are not re-validated.
Do I lose usability?
Slightly - maybe 1% of attempted passwords are in the leaked corpus. But those are the exact passwords that get credential-stuffed. Net: big security win, tiny UX cost.
Is this the same as Lovable's site password gate?
No. Lovable/share password protection is a simple gate on the preview URL. Leaked password protection is a Supabase Auth setting that blocks weak/breached user account passwords. You usually want both for different reasons - and neither replaces RLS.
Does this work with magic links and OAuth?
Leaked password checks apply when a password is set or changed. Magic-link-only and pure OAuth users never set a password in your project, so this toggle does not affect them. Still enable email verification and monitor OAuth redirect URLs.
Can I enforce this only in production?
The Auth setting is per Supabase project. Use separate Supabase projects (or branches) for dev/staging/prod and enable the control on production at minimum. Do not share one project across environments with mixed policies.
What error does the client see when a password is rejected?
Supabase returns an auth error whose message typically references a weak or compromised password. Catch it in your signup UI and show a human explanation - users often think the form is broken because the same password works elsewhere.
Is leaked-password protection enough for production auth?
No. Pair it with minimum length, email confirmation, rate limits on token endpoints, MFA for privileged roles, and RLS on every table. It blocks a common credential class; it does not authorize data access.

Password gate is not app security

A share password only blocks casual visitors. Scan RLS, keys, and auth on the real app surface behind the gate.

14-day free trial · Cancel anytime

RUN FULL SCAN →