Skip to content

Conversation

@BoltTouring
Copy link
Contributor

@BoltTouring BoltTouring commented Jan 8, 2026

Implements two layers of spam protection for the grant report submission form:

  1. Honeypot Field - Hidden `company_website` field that bots fill but humans don't

    • Returns success (200) but silently rejects if filled
    • Logs spam attempts for monitoring
  2. Time-Based Validation - Requires minimum time between form load and submission

    • Default: 2 seconds (configurable via `SPAM_MIN_FORM_TIME` env var)
    • Rejects submissions that happen too quickly
    • Logs suspiciously fast submissions

Changes

  • Added honeypot field to `GrantReportForm` component (hidden with CSS + aria-hidden)
  • Added `form_loaded_at` timestamp tracking when form mounts
  • Added spam validation checks in `/api/report` endpoint
  • Passes `form_loaded_at` through preview page to final submission

Testing

  • ✅ Honeypot field catches bots (tested manually via local)
  • ✅ Time validation prevents too-fast submissions
  • ✅ Legitimate submissions work normally
  • ✅ Spam attempts are logged for monitoring

Configuration

  • `SPAM_MIN_FORM_TIME` environment variable (default: 2000ms)

Both protections run before any GitHub API calls, preventing wasted API quota on spam.

BoltTouring and others added 6 commits November 6, 2025 09:10
Reformatted Robos' bio for better readability.
- Add honeypot field (company_website) to catch bots
- Add time-based validation to prevent too-fast submissions
- Honeypot: Returns success but silently rejects if filled
- Time validation: Requires minimum 2-3 seconds between form load and submission
- Both protections log spam attempts for monitoring
- Configurable via SPAM_MIN_FORM_TIME environment variable
@BoltTouring BoltTouring requested a review from dergigi January 8, 2026 01:05
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
os-website Ready Ready Preview, Comment Jan 8, 2026 1:13am

Resolved conflict in data/authors/robos.mdx:
- Accept incoming change: use robos.jpg (from master) instead of rob.jpg
- Remove unused formLoadedAt state variable
- Fix prettier formatting for localStorage.setItem
- Fix TypeScript error in grant.ts with type assertion
@BoltTouring
Copy link
Contributor Author

I implemented this for report submissions instead of applications. Will fix for both a bit later!

@dergigi
Copy link
Member

dergigi commented Jan 13, 2026

Re-implemented & merged with #555

@dergigi dergigi closed this Jan 13, 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.

4 participants