← All posts
·4 min read·GuardLayer

Supabase: "Password is known to be weak and easy to guess" (fix)

SupabaseAuthPasswordsErrors

"Password is known to be weak and easy to guess, please choose a different one." means Supabase Auth found the password in HaveIBeenPwned's list of passwords from known data breaches and refused it. It comes from the leaked password protection setting. Nothing is wrong with your code or your project. The user has to pick a different password, and your form should tell them that clearly instead of showing "Sign-up failed".

What triggers it

The project has Prevent use of leaked passwords turned on (Authentication → Sign In / Providers → Email). With it on, Supabase Auth checks every new password against HaveIBeenPwned and rejects any match. That covers:

  • supabase.auth.signUp()
  • supabase.auth.updateUser({ password }), including the reset-password flow
  • creating or updating a user's password through the admin API

The response is HTTP 422 with error code weak_password, that exact message, and pwned in a list of reasons. The password never leaves Supabase: Auth sends only the first 5 characters of its SHA-1 hash to HaveIBeenPwned and compares the results itself. More on the setting, including where to find it and why it's Pro-only: Supabase leaked password protection.

It often shows up right after someone turns the setting on, or the first time you test sign-up with a password like password123 or qwerty123. Those are in every breach list.

Why "weak" when the password looks strong?

The check isn't about length or symbols. It asks one question: has this exact password appeared in a breach? A long password with digits and symbols is rejected if someone, somewhere, used it before and it leaked. That's the point: attackers try leaked passwords first (credential stuffing), whatever they look like.

Your minimum-length and required-character rules are separate checks, with their own reasons (length and characters) and their own messages. One error object covers all three.

Show a clear message in your form

In supabase-js the error is an AuthWeakPasswordError, and reasons says which checks failed:

import { isAuthWeakPasswordError } from '@supabase/supabase-js'

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

if (isAuthWeakPasswordError(error)) {
  if (error.reasons.includes('pwned')) {
    setError('This password has appeared in a data breach. Please choose a different one.')
  } else if (error.reasons.includes('length')) {
    setError('That password is too short.')
  } else if (error.reasons.includes('characters')) {
    setError('Add the required letters, digits or symbols.')
  }
  return
}
if (error) {
  setError(error.message)
  return
}

Use the same check on your change-password and reset-password pages, because updateUser() returns the same error.

Two things to avoid:

  • Don't show the raw message alone. "Known to be weak" confuses people whose password looks strong. Say it appeared in a data breach.
  • Don't turn the setting off to make the error go away. It's protecting your users from account takeover. Fix the message instead.

Existing users with a breached password

Existing users aren't locked out. When they sign in with signInWithPassword(), the sign-in succeeds, and the response includes a weakPassword object if their password is in a breach:

const { data } = await supabase.auth.signInWithPassword({ email, password })

if (data.weakPassword?.reasons.includes('pwned')) {
  // Signed in. Prompt them to choose a new password.
}

That's your chance to ask them to change it, before someone else tries it.

How to test it

  1. Make sure Prevent use of leaked passwords is on (Pro plan and up).
  2. Sign up with a password you know is breached, such as password123. You should get weak_password with pwned.
  3. Sign up with a long random password from a password manager. It should go through.
  4. Repeat on the change-password page.

If you never get the error, the setting is off. If the switch is greyed out, the project is on the Free plan; set a minimum length of 10 to 12 and required characters in the same panel instead.

Does GuardLayer check this?

Yes. The Live check reads your project's Auth settings read-only and tells you whether leaked password protection is off, together with the minimum password length and the other sign-up settings that matter, next to the tables anyone with your publishable key can read.

FAQ

What does "Password is known to be weak and easy to guess" mean in Supabase? The password appears in HaveIBeenPwned's breach data, and the project has leaked password protection turned on, so Supabase Auth refused it. The user needs a different password.

What error code does Supabase return? HTTP 422 with code weak_password and pwned in the reasons list. In supabase-js, isAuthWeakPasswordError(error) returns true.

Why did it start happening suddenly? Someone turned on "Prevent use of leaked passwords" in the Email provider settings, or you're testing with a common password that's in breach lists.

Can I turn it off? Yes, in Authentication → Sign In / Providers → Email, but don't. It stops users from signing up with passwords attackers already have. Show a clearer message instead.

Does Supabase send the password to HaveIBeenPwned? No. Only the first 5 characters of its SHA-1 hash are sent, and Supabase compares the returned list itself.

Check your Supabase Auth settings and tables, free

Connect your Supabase project read-only. GuardLayer checks your Auth settings (leaked passwords, email confirmation, secure email change, token rotation, CAPTCHA, MFA) and your RLS, policies and grants, and says how to fix each problem. It never reads your rows and can't change anything.

Check my Supabase project

Prefer to check code instead? Scan your repo, no signup.

Keep reading