OWASP / OWASP/SecurityShepherd
Wire up userLock brute-force protection (stored procedure exists but is unused)
@ismisepaul is already working on this.
Since Apr 1, 2026.
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 515
- Avg merge
- 3h 46m
- Merged PRs (30d)
- 1
Description
Summary
The userLock stored procedure exists in coreSchema.sql (line 181) and implements brute-force protection: increments badLoginCount on failed logins, suspends the account for 30 minutes after 3 failures within 10 minutes. However, it has never been called from Java code — it was added as part of the schema in #344 (2018) with no follow-up.
The read side partially works: authUser() already checks suspendedUntil and rejects suspended users, and calls userBadLoginReset on successful login. The missing piece is calling userLock on failed password verification.
Considerations before implementing
- Account lockout DoS: anyone who knows a username can lock the account by submitting 3 bad passwords. In a classroom setting, students could lock each other (or the admin) out mid-session.
- Needs an admin toggle: there's no setting to enable/disable this. Should add a key to the
settingstable (e.g.enableBruteForceProtection) so admins can opt in. - SSO users:
userLocktakesuserName, so failed password attempts against SSO accounts could incorrectly lock them out of SSO. The failure path should skip lockout for non-logintype users. - User enumeration timing: calling
userLockonly for existing users creates a timing side-channel. Consider whether this matters for a training platform.
References
- Stored procedure:
src/main/resources/database/coreSchema.sqlline 181 - Auth method:
src/main/java/dbProcs/Getter.javaauthUser() - Surfaced during review of #821
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.