Does your login say the email isn't registered? It leaks your users
A message that says whether an account exists lets anyone learn who uses your site. The fix is one message and one response time for login, password reset and sign up, plus a per-account limit on attempts.

A very polite login page: you type a wrong email, and it tells you "this email isn't registered with us". That same kind sentence works for anyone holding a list of emails: they try them one by one, and the page tells them who your customers are. This article shows where that information leaks on your site, in the messages and in the response time, and how to close it without hurting real users.
What is account enumeration?
Account enumeration is when a site answers differently for an account that exists and one that doesn't, so anyone can learn who is registered just by comparing the answers.
The difference can be in the message text, the status code, or the response time. The attacker doesn't need to get into any account: knowing that an account exists is enough to aim password guessing and fake emails at it.
Where does this leak on your site?
Account enumeration shows up on three pages: login, password reset and sign up, because all three take an email and answer about it.
The OWASP Authentication Cheat Sheet gives a wrong message and a right message for each page:
Page | Message that leaks | Message OWASP recommends |
|---|---|---|
Login | Login failed, invalid user ID. | Login failed; Invalid user ID or password. |
Password reset | This email address doesn't exist in our database. | If that email address is in our database, we will send you an email to reset your password. |
Sign up | This user ID is already in use. | A link to activate your account has been emailed to the address provided. |
The point of the right messages is that they are the same whether the account exists or not. On sign up, only the owner of the email learns from their inbox that they already have an account.
Why does response time leak too?
Response time leaks because the server usually does more work when the account exists, so the attacker measures the time instead of reading the message.
The same OWASP sheet says the processing time can be significantly different between success and failure, which lets the attacker tell a wrong username from a wrong password. On login the reason is plain: if the email doesn't exist, the code returns at once, and if it does, it computes the password hash, which is slow on purpose. The fix is to do the same work in both cases:
// DUMMY_HASH: a real hash of a random password, made once at startup
const user = await db.user.findUnique({ where: { email } });
const hash = user ? user.passwordHash : DUMMY_HASH;
const ok = await verifyPassword(hash, password);
if (!user || !ok) {
return res.status(401).json({ error: 'Login failed; Invalid user ID or password.' });
}For password reset, the OWASP Forgot Password Cheat Sheet asks for one message for existing and non-existing accounts, and responses that take a consistent amount of time so nobody can enumerate which accounts exist. The easiest way is to send the email in the background and answer at once:
app.post('/forgot-password', async (req, res) => {
const user = await db.user.findUnique({ where: { email: req.body.email } });
if (user) queueResetEmail(user); // sent in the background, not awaited
res.json({
message: 'If that email address is in our database, we will send you an email to reset your password.',
});
});Now the answer and its timing are the same, and the email only reaches the account owner.
How do you stop someone trying thousands of emails?
Even with one message you need a limit on attempts, because the attacker can still try many passwords on accounts they learned about somewhere else.
The authentication sheet says the failed login counter should be tied to the account itself, not to the source IP address, since an attacker can switch addresses. The forgot password sheet asks for protection against excessive automated submissions, with rate limiting on a per-account basis as one example. And it asks that the reset link token be randomly generated with a cryptographically safe algorithm, long enough to resist brute force, single use, and expire after an appropriate period.
How do you test your own pages?
The fastest test is to compare two answers: one for a registered email and one for an unregistered email, on each of the three pages.
Open the login page and try your email with a wrong password, then an unregistered email. You should get the same message.
Do the same on the password reset page and the sign up page.
Open the browser's developer tools, Network tab, and compare the status code and response time of the two tries. A steady gap in time or a different status code is a leak too.
Try the same against the API directly if your mobile app uses other endpoints for login and sign up.
Where do you start today?
Start with the password reset page, because it's the easiest fix: one message, and the email in the background. Then fix the login message and timing, and sign up last.
While you're in the login code, make sure the passwords themselves are stored right, as the Argon2id article explains, and that the session it opens is protected, with the session cookie flags check. And if you want someone to try your platform's login pages the way an attacker would, that's the job of a penetration test with Muhassan.
Try an unregistered email on your login page now: what does it tell you?
FAQ
If all it reveals is that an email is registered, what's the harm?
The attacker gets a list of real accounts, so they aim password guessing and fake emails at them instead of trying blind.
Won't a real user get confused if I don't tell them the email is wrong?
A little, but the shared reset message tells them a link will arrive if the email is on file, so if nothing arrives they know to try another address.
Should the attempt limit be per IP or per account?
Per account. OWASP says the failed login counter should be tied to the account itself, not to the source IP address.


