Skip to content

Harden login honeypot against autofill false positives - #42

Merged
alexpricedev merged 2 commits into
mainfrom
fix/honeypot-autofill-false-positives
Jul 26, 2026
Merged

Harden login honeypot against autofill false positives#42
alexpricedev merged 2 commits into
mainfrom
fix/honeypot-autofill-false-positives

Conversation

@alexpricedev

Copy link
Copy Markdown
Owner

Summary

  • Honeypot field company_website matched browser autofill/password-manager heuristics, causing real logins to silently drop (feigned success, no magic link sent)
  • Renamed to referral_code, extracted shared Honeypot component 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 invisible
  • Fixed a login.test.ts mock leak: the auth middleware mock in "redirects authenticated user" was never restored, which would corrupt other test files if the suite runs in one process

Ported from the-8020-pathway@c5a9d5171f9 (same bug, same fix, adapted — Billet has no signup flow, so only login changed).

Test plan

  • bun run check (lint + typecheck) passes
  • Full test suite passes (340 tests)
  • Manually confirm /login renders and submits correctly in browser

🤖 Generated with Claude Code

alexpricedev and others added 2 commits July 24, 2026 18:54
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>
@alexpricedev
alexpricedev merged commit 1aa8537 into main Jul 26, 2026
3 checks passed
@alexpricedev
alexpricedev deleted the fix/honeypot-autofill-false-positives branch July 26, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant