An ID desk that gives too much away
Watch it happen
Mallory learns which customers exist from the clerk’s different answers, then gets in with the default admin code.
Alice and Mallory both walk up to the bank. Everyone has to stop at the ID desk first.
In bank terms and app terms
| In the bank | In your app |
|---|---|
Are you exposed?
Your login says “user not found” for some emails and “wrong password” for others. You seeded an admin or test user (admin, test, demo) and never removed or changed it. Failed logins return differently shaped responses, or take noticeably longer for real accounts.
Return one generic message and status for every failed login, and keep response times similar. Delete seeded and default accounts before launch, and force strong passwords for admins. Add rate limits and lockouts so robbers cannot keep guessing (see Missing rate limits).
It has happened to real companies
iCloud (2014) — The authors of a tool called iBrute claimed it used Apple's Find My iPhone API to guess passwords because the API lacked brute-force countermeasures. After the celebrity photo leaks, Apple said the accounts were compromised by a very targeted attack on user names, passwords and security questions, and not by a breach of its systems, including iCloud or Find My iPhone. It was never confirmed that iBrute was used in those leaks, but unlimited password guessing is exactly what an account-lockout check is meant to catch.
What it looks like in code
// GOOD: Same error message for all auth failures
if (!user || !validPassword) {
return NextResponse.json(
{ error: "Invalid email or password" }, // Same message regardless of cause
{ status: 401 }
)
}
// GOOD: Account lockout after N attempts
const attempts = await getLoginAttempts(email)
if (attempts >= 5) {
return NextResponse.json({ error: "Too many attempts. Try again later." }, { status: 429 })
}
Ask your AI tool to fix it
Paste this into Cursor, Claude, Lovable, Bolt or whatever you build with.
Audit my login and signup routes for weak authentication. Make every failed login return the same generic message and status code whether the email exists or not. Remove any seeded default users such as admin/admin or test/test, and make sure admin passwords come from environment variables. List what you changed.Where this comes from
The facts, figures and fixes on this page were checked against these sources on 25 Oct 2026. They are linked so you can check for yourself.
- Authentication Cheat SheetOWASPUse one generic failure message and similar response times so logins do not reveal accounts
- WSTG: Testing for Account Enumeration and Guessable User AccountOWASPDifferent error messages for known and unknown users let attackers list real accounts
- WSTG: Testing for Default CredentialsOWASPDefault accounts such as admin/admin left in place are a common way in
- Top 10:2021 A07 Identification and Authentication FailuresOWASPDefault credentials and unlimited guessing are listed as authentication failures
- Apple Media Advisory (September 2014)AppleApple's statement: a very targeted attack on user names, passwords and security questions
- iCloud Flaw Not Source of Celebrity Photo TheftTidBITSiBrute guessed passwords via Find My iPhone; not confirmed as the cause of the leaks
Spot a mistake or something out of date? Report a correction · How these guides are made and checked
The free, open-source scanner checks for most of the problems in these guides.