Detect compromised passwords via Have I Been Pwned#951
Draft
danielcompton wants to merge 1 commit into
Draft
Conversation
Check passwords against the HIBP Pwned Passwords range API (k-anonymity: only the first 5 chars of the SHA-1 hash leave the app) on registration, password change, and reset, and on login. A login with a known-compromised password clears the stored password, emails the user, and forces them through the forgot-password flow before they can log in again. The HIBP client fails open on errors so a third-party outage can't lock users out. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #725. Passwords are checked against the HIBP Pwned Passwords range API (k-anonymity — only the first 5 chars of the SHA-1 hash leave the app) on registration, password change, and reset (rejecting compromised passwords up front), and on login. A login with a known-compromised password clears the stored password, emails the user, and forces them through the forgot-password flow before they can log in again. The new
clojars.hibpclient fails open on errors and short-timeouts so a third-party outage can't lock users out, and the length-bounded validation guard avoids an HTTP call for passwords that fail length checks anyway. Wired in via a new:hibpsystem component (real + mock) with unit and integration test coverage.🤖 Generated with Claude Code