Skip to content

Security basics

Supabase "Password should be at least 6 characters", and why six

Supabase says "Password should be at least 6 characters" because 6 is its floor. How to raise it, and what happens to existing users.

Vlad Tkachenko9 min read
A combination padlock with six lit dials, two empty dashed dial slots beside it, and an amber slip of combinations behind.

In short

  • "Password should be at least 6 characters" is Supabase Auth refusing a new password that is shorter than your project's minimum, at sign-up or when a password is changed.
  • Six is Supabase's default and the lowest minimum it accepts. Its own guide says anything under eight is not recommended.
  • Raise it under Authentication → Sign In / Providers → Email, along with required characters and, on the Pro Plan and above, leaked password protection.
  • Short passwords set before the change keep working. Sign-in hands your app a weakPassword note rather than an error, and that note is how you ask people to change them.

Somebody tries to sign up for your app, and the form answers with one red line:

Password should be at least 6 characters.

Or you meet it yourself, trying out the reset-password page your builder made. The fix looks obvious: type a longer password. It works, and the message goes away.

Your Lovable, Bolt, v0, Cursor, Claude Code or Replit app is passing on a message from Supabase, and nobody picked the six in it. Six is the setting every Supabase project starts with and the lowest one Supabase allows, and Supabase's own guide says anything under eight is not recommended. So "Password should be at least 6 characters" also tells you something about your project: its password rule is still where Supabase left it.

Raising the number is one setting, and it does nothing for the passwords your users already have. Those need a second step, and Supabase's own guide describes it wrongly. It says your app will see an error at sign-in. The code signs the person in and puts a note beside the session, which an app waiting for an error never reads.

What does "Password should be at least 6 characters" mean?

It means Supabase Auth, the part of Supabase that handles sign-ups and sign-ins, refused a new password because it is shorter than your project's minimum.

The sentence is written into the Auth server's password check as "Password should be at least %d characters.", with your project's minimum in place of the number. The check runs whenever a password is being set. On sign-up it runs before Supabase has even looked at whether the email is registered. It also runs when a signed-in person changes their password, which is what a reset-password page does when it calls supabase.auth.updateUser({ password }).

The reply is HTTP 422 with the code weak_password. In your app it arrives as an AuthWeakPasswordError, and alongside the message it carries a list called reasons naming each rule the password broke, here length. Supabase's error code reference describes weak_password as a user "signing up or changing their password without meeting the password strength criteria."

Think of each account as a combination padlock on that person's part of your app, with the password as its combination. The minimum length is the number of dials. Supabase fits a lock of at least six dials, and a combination that leaves a dial empty is sent back.

Why is the minimum six?

Because six is both Supabase's default and its floor. In the Auth server's configuration code, defaultMinPasswordLength is 6, and a minimum set lower than that is raised to 6 when the server starts. You can ask for more characters. Asking for fewer has no effect.

It is also a number Supabase tells you to move off. Its password security guide says to "set a large minimum password length" and that "anything less than 8 characters is not recommended."

At the padlock, every dial you add multiplies the combinations someone has to work through. A project still on six has the smallest lock Supabase will fit on every account in it.

Supabase can be set to ask for more than six characters and never fewer. Its own guide calls anything under eight not recommended.

How do I raise the minimum password length in Supabase?

Open Authentication → Sign In / Providers in your Supabase dashboard, then the Email provider. That is where Supabase's guide sends you for these settings, and three of them decide what a new password has to be:

SettingWhat it refusesThe message the person seesreasons
Minimum password lengtha password shorter than the number you set, which is 6 or morePassword should be at least 8 characters.length
Required charactersa password missing one of the character groups you choosePassword should contain at least one character of each: (the groups you chose)characters
Leaked password protectiona password that appears in HaveIBeenPwned's leaked listPassword is known to be weak and easy to guess, please choose a different one.pwned

The first row shows the message for a minimum of 8. For required characters, the guide's advice is "the strongest option of requiring digits, lowercase and uppercase letters, and symbols." When a password breaks more than one rule, the sentences arrive together in one message and reasons lists each of them.

One more place holds the number. If your sign-up page checks the password length itself, it has its own copy of the rule, and that copy stays at six when you change the setting. Change it to match, or the form lets a password through that Supabase then refuses with the same red line, now showing your new number.

What does leaked password protection check?

It checks each new password against HaveIBeenPwned's Pwned Passwords list, which collects passwords exposed in other sites' breaches, and refuses one that is on it. Supabase's guide says it uses "the open-source HaveIBeenPwned.org Pwned Passwords API" to "reject passwords that have been leaked and are known by malicious actors." It is available on the Pro Plan and above.

The password itself stays with Supabase. The library Supabase uses for the check hashes the password with SHA-1 and sends only the first five characters of the hash. What comes back is every leaked password sharing those five characters, and the comparison happens on Supabase's side.

In padlock terms, the number of dials decides how many combinations there are, and this setting takes out the ones already written down. Somebody trying to open a lock they did not set starts with combinations that opened other locks, because breaches publish those, and a lock set to one of them opens early however many dials it has.

While it is off, the Security Advisor in your dashboard can list it as a warning, auth_leaked_password_protection. On the Free Plan the switch is not available, so the minimum length and required characters are what you have to work with.

All three settings guard the door people sign in through. A table your Row Level Security leaves readable needs no password at all, and that is the side our free scan looks at. It asks each table your app names how many rows a visitor with no login could get, reads only the count, and takes about 20 seconds with no account: scan your app.

What happens to accounts that already have a short password?

They keep signing in. Supabase's guide says "existing users can still sign in with their current password even if it doesn't meet the new, strengthened password requirements", and the new rules reach them only when they set a new password.

The guide then says such a user "will encounter a WeakPasswordError during the signInWithPassword process." The code behaves differently. In the Auth server's sign-in code, the strength check runs only after the password has been accepted, and a weak result stops nothing: the person is signed in, and the reply carries a weak_password note beside the session. supabase-js passes it to your app as data.weakPassword, with the same reasons list, and error stays empty.

So an app that waits for an error at sign-in never sees one, and every short password from before the change stays as it is until somebody reads that note:

const { data, error } = await supabase.auth.signInWithPassword({ email, password })
if (data?.weakPassword) askForANewPassword(data.weakPassword.reasons)

askForANewPassword stands for a page of your own that calls supabase.auth.updateUser({ password }), the same call a reset page makes, so the new password meets the new rules.

At the padlock, this is a lock that opens for the right combination and hands the owner a card saying their combination no longer meets the rule. Your app decides whether anybody reads the card.

With leaked password protection on, that sign-in check also looks the password up in the leaked list. So pwned can turn up in data.weakPassword.reasons for somebody who chose their password years ago and has never heard that it leaked.

A stricter rule turns a new short password away. An old one still signs in, and the reply carries a weakPassword note your app has to read.

What should my sign-up and reset pages do?

Show the rule before anyone types, and decide on the code rather than the sentence.

  • Put the rule under the password field, with the number you set and the groups you require, so nobody meets it for the first time as an error.
  • Branch on the error code. isAuthWeakPasswordError(error) tells you it is this one, and error.reasons says which rule failed, so the form can point at it. Supabase's error code reference says to identify errors by their code rather than by matching the message text.
  • Keep the form's own length check at the same number as the setting, or remove it and let Supabase do the checking.
  • Read data.weakPassword after every sign-in and send those people to choose a new password.
  • Expect one more message on the reset page. "New password should be different from the old password.", code same_password, comes back when somebody types the password they already have.

The first branch, in code:

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

const { error } = await supabase.auth.signUp({ email, password })
if (isAuthWeakPasswordError(error)) showPasswordRules(error.reasons)

If a builder writes these pages for you, the five points above can go in as the instruction.

Keeping the data behind the sign-in the way you left it

A stronger password rule protects the sign-in from today on, and two things behind it can still change: a table can become readable without signing in, and somebody using an account that is not theirs can change its rows.

Reeve Monitor keeps checking from outside:

  • the full security check every hour, including how many rows a visitor with no login can count in the tables your app names
  • whether your app answers, every 60 seconds, and up to 10 more pages you choose
  • an alert by email, Telegram, Slack or webhook when the app goes down or a page breaks
  • a monthly report on your app, written for you

Reeve Care keeps a copy of your Supabase database, accounts included:

  • an encrypted copy on a schedule, on Reeve's own storage in the EU, outside your Supabase account
  • the auth schema your users' accounts live in, so they come back with everything else
  • each copy verified before it counts, by counting the rows in every table
  • your uploaded files as well, once you connect a Storage credential
  • a one-click restore, with a safety copy of the current state taken first
  • everything Monitor does

What to do now

What to do

  • Open Authentication → Sign In / Providers → Email and set the minimum password length to 8 or more.
  • Choose required characters there too, and on the Pro Plan or above switch on leaked password protection.
  • Change any length check in your own sign-up form to the same number.
  • After sign-in, read data.weakPassword and ask those people to choose a new password.
  • Branch on isAuthWeakPasswordError and show error.reasons, rather than printing the raw sentence.

If people can sign up and then cannot get back in, Invalid login credentials covers that end of the form. What Supabase secures for you and what your own project's settings decide are separate questions, and is Supabase secure takes them one at a time.

FAQ

How do I change the minimum password length in Supabase?

In your Supabase dashboard, open Authentication, then Sign In / Providers, then the Email provider, and set the minimum password length there. Supabase will not go below 6, and its own guide says anything under 8 is not recommended. If your sign-up form checks the length itself, change the number in the form as well.

Can I set the Supabase minimum password length lower than 6?

No. Six is the default, and Supabase Auth raises any lower setting back to 6 when it starts. You can ask for more characters, never fewer.

Will raising the minimum lock out users who already have a shorter password?

No. The rules are checked when a password is set, at sign-up and when it is changed. People with an older, shorter password keep signing in, and each sign-in returns a weakPassword note next to the session, which your app can use to ask them to choose a new one.

Does leaked password protection send my users' passwords to HaveIBeenPwned?

No. The library Supabase uses hashes the password with SHA-1 and sends only the first five characters of that hash. The list that comes back covers every leaked password sharing those five characters, and the match is made on Supabase's side. The feature is available on the Pro Plan and above.

What does "Password is known to be weak and easy to guess" mean in Supabase?

Leaked password protection is on, and the password is in HaveIBeenPwned's list of passwords exposed in other sites' breaches. The reason in the error is pwned. The person needs a different password, one that has not appeared in a breach.

Written by

Vlad Tkachenko

Founder, Reeve

I spend my time looking at apps built with Lovable, Bolt, v0, Cursor and Replit, and at the short list of mistakes that keep turning up in them.

More about the author

Read next

All articles

Back up your Supabase database before your next change

Reeve keeps an encrypted copy on a schedule and restores it for you if something breaks.

See Supabase backups

Automated external check, not a full audit. Absence of findings is not a guarantee of safety.