Skip to content

build: the house form guard on /build/invoice (0.11.2) - #78

Merged
sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
build-form-guard
Oct 29, 2026
Merged

sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
build-form-guard

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

Anthony: "add our honeypot to that form".

The plain website honeypot could not catch INV-043/044: a bot that POSTs straight at /build/invoice never sends the hidden field. This puts the full @profullstack/form-guard check on the form:

  • /build mints a signed token per render (binding build-invoice, secret = the pay.agent key unless guard.secret is set) plus form-guard's honeypot, hidden with the existing .hp class (CSP has no inline styles). The page is now cache-control: no-store so a token is never shared.
  • /build/invoice: no token, a forged token or a filled honeypot → redirect to /build, no invoice, no email. A stale (2h+) or too-fast (<3s) submit gets the form back with its values. The stock-enquiry check (build: judge stock enquiries by what is left, via @profullstack/form-guard (0.11.1) #76) and our rate limit stay.
  • Tests: a direct POST and a forged token make no invoice; every other case now renders /build for its token. 196 pass, tsc clean.

🤖 Generated with Claude Code

The INV-043/044 spam passed the old honeypot because a bot that POSTs
without rendering /build never sends the hidden field. /build now mints a
@profullstack/form-guard token per render (no-store), and /build/invoice
drops a missing or forged token or a filled honeypot (no invoice, no email)
and gives a stale or too-fast submit the form back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit 9663b89 into main Oct 29, 2026
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