The login check answers only yes/no — whether a match exists — but it accepts a regex operator in the password, so you confirm the admin password prefix one character at a time until you have it all, then submit it.
A login check that only answers yes or no and takes its data as JSON, plus a second box to submit the password you recover.
You submitted the correct admin password.
Why the solution worked
The regex operator turns a yes/no answer into a character-by-character leak. Hiding output does not close the hole while the operator reaches the filter. The fix is forcing a string type and blocking operators.
The root cause
Accepting a regex operator in a user value turns the filter into an oracle. The root is not enforcing the value type.
How the code is fixed
Do not accept operators in a password value; compare a string against a stored hash.
Vulnerable code
// password may be { $regex: '^A' }, turning the check into a per-character oracle.
const match = db.users.findOne({ username, password });
Safe code
// Only a string password is compared, and to a stored hash, never a live regex.
if (typeof password !== 'string') return res.status(400).end();
const user = db.users.findOne({ username });
const match = user && verifyHash(password, user.passwordHash);
Impact in the real world
Blind extraction leaks passwords and any field character by character, and automation makes it fast.
How defenders detect it
Defenders enforce value types, alert on many similar regex-operator requests from one source, and rate-limit.
Your workspace now has a Server logs tab: your own attack, as the defender saw it, with the alerting lines marked.
Solved with the walkthrough. Put it aside and solve again to earn the feather.