OWASP / OWASP/SecurityShepherd

Wire up userLock brute-force protection (stored procedure exists but is unused)

Open
#824 0 comments 0 reactions 1 assignee View on GitHub

@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 settings table (e.g. enableBruteForceProtection) so admins can opt in.
  • SSO users: userLock takes userName, so failed password attempts against SSO accounts could incorrectly lock them out of SSO. The failure path should skip lockout for non-login type users.
  • User enumeration timing: calling userLock only for existing users creates a timing side-channel. Consider whether this matters for a training platform.

References

  • Stored procedure: src/main/resources/database/coreSchema.sql line 181
  • Auth method: src/main/java/dbProcs/Getter.java authUser()
  • Surfaced during review of #821

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.