No password complexity requirements beyond minimum length #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
SignupRequestonly enforces@Size(min = 8)on passwords. There are no checks for character diversity or known-breached passwords.Affected files
SignupRequest.java—@NotBlank @Size(min = 8) String passwordRecommended fix
Consider:
Severity
Low — minimum length is acceptable but could be strengthened.
👨💻 Kai — Frontend Engineer
This is a backend issue, but it has a direct frontend implication: whatever password rules the backend enforces, the signup form (A2) and the join-household form (A4) need to communicate them clearly to the user before they submit.
Frontend impact of each proposed fix:
@Size(max = 72)(or whatever the BCrypt boundary is), the<input type="password">should have a matchingmaxlengthattribute so users aren't cut off silently. I'd setmaxlength="128"on the input and let the backend enforce the actual BCrypt limit — but the two need to agree.Questions for me before implementation:
🔧 Backend Engineer — Password Complexity (Issue #15)
Good catch. The BCrypt DoS vector is the more pressing of the two concerns. Let me break down both recommendations:
BCrypt max length (higher priority):
@Size(max = 72)toSignupRequest.passwordcloses this with zero friction.@Size(max = 72)at the Java String level (characters) is a safe approximation that slightly undershoots — that's fine. Document the reason in a comment so no one "optimizes" it away later.@NotBlank @Size(min = 8, max = 72) String password. Add a validation test for the boundary (71, 72, 73 chars).HIBP integration (lower priority, worth discussing):
Questions:
PasswordValidatorabstraction planned, or is validation staying in the Bean Validation annotations? If we're adding HIBP, a dedicatedPasswordValidationServicewould be cleaner than stuffing it into a custom@Constraint.🧪 QA Engineer — Password Complexity (Issue #15)
The current test coverage for password validation is presumably just the happy path and the
@Size(min = 8)rejection. Here's what I'd want covered after any fix lands.Tests for the BCrypt max-length fix (if
@Size(max = 72)is added):Tests for HIBP integration (if implemented):
Integration test concern:
@MockBeanin the test is straightforward. If it's a static call, it's harder to test and harder to fail-open.Existing tests to verify still pass:
Questions:
🔐 Sable — Security Engineer
Good issue — this is exactly the kind of low-severity finding that gets ignored until it isn't. Let me add some depth to both recommendations.
BCrypt DoS — this should be treated as Medium, not Low:
/signuprepeatedly. BCrypt at cost factor 12 is intentionally slow — ~200–400ms per hash. Each oversized request holds a thread for that duration with zero authentication required. At modest concurrency this could saturate the thread pool.@Size(max = 72)inSignupRequest. Ship this immediately. It's a one-line fix with a test, and it closes the vector entirely.HIBP integration — genuinely useful, worth doing thoughtfully:
Additional hardening to consider alongside this issue:
/signupendpoint — without it, the BCrypt fix reduces per-request cost but doesn't prevent volume attacks.@RateLimitor Spring's built-in throttling once the max-length is in place.Questions:
/signup,/login)? If not, that's a related finding worth opening as a separate issue.🎨 Atlas — UI/UX Designer
This is a backend security issue, but password rules always have a UX dimension. A few thoughts from the design side.
If a max length is added:
maxlengthattribute — silently truncating input in the browser (or worse, accepting it and rejecting server-side) is a poor experience.If HIBP or character diversity rules are added:
--color-error/--yellow-text/--green-deeper) would surface feedback before the user submits — reducing failed submission frustration.Consistency check:
Questions: