Harden login honeypot against autofill false positives - #42
Merged
Conversation
The hidden honeypot field was named company_website, which browser autofill and password managers populate for real users. A filled honeypot is treated as a bot: the request feigns success but sends no magic link, so genuine logins were silently dropped. Rename the field to referral_code, a name no autofill category matches, and add a shared Honeypot component that sets password-manager opt-out attributes (data-1p-ignore, data-lpignore, data-bwignore, data-form-type). Log honeypot trips so a false positive is no longer invisible. Also fix login.test.ts: the "redirects authenticated user" test mock.module()s the auth middleware and never restored it, leaking the stub into other test files when the full suite runs in one process. Ported from the-8020-pathway@c5a9d5171f9. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Flipped the target hash's last hex digit to a fixed "0", a no-op 1-in-16 of the time when the digest already ended in "0" — the "tampered" payload was then identical to the original, still passed signature verification, and the test failed asserting false. Pick a digit guaranteed to differ from the original instead. Co-Authored-By: Claude Sonnet 5 <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.
Summary
company_websitematched browser autofill/password-manager heuristics, causing real logins to silently drop (feigned success, no magic link sent)referral_code, extracted sharedHoneypotcomponent with password-manager opt-out attributes (data-1p-ignore,data-lpignore,data-bwignore,data-form-type), and log honeypot trips so future false positives aren't invisiblelogin.test.tsmock leak: the auth middleware mock in "redirects authenticated user" was never restored, which would corrupt other test files if the suite runs in one processPorted from
the-8020-pathway@c5a9d5171f9(same bug, same fix, adapted — Billet has no signup flow, so onlyloginchanged).Test plan
bun run check(lint + typecheck) passes/loginrenders and submits correctly in browser🤖 Generated with Claude Code