Skip to content

[77] [Backend] Create CAPTCHA verification for auth nonce requests - #183

Open
Goodnessukaigwe wants to merge 1 commit into
Hamplard-Hub:mainfrom
Goodnessukaigwe:fix/77-backend-create-captcha-verification-for-auth-nonce-requests
Open

[77] [Backend] Create CAPTCHA verification for auth nonce requests#183
Goodnessukaigwe wants to merge 1 commit into
Hamplard-Hub:mainfrom
Goodnessukaigwe:fix/77-backend-create-captcha-verification-for-auth-nonce-requests

Conversation

@Goodnessukaigwe

@Goodnessukaigwe Goodnessukaigwe commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds server-side CAPTCHA verification before authentication nonce issuance so bots cannot obtain a challenge nonce without a valid provider-checked token.

  • CAPTCHA tokens are verified with the configured provider (CAPTCHA_VERIFY_URL) via axios. The secret stays in environment/configuration (CAPTCHA_SECRET_KEY); client-reported success flags are ignored.
  • Failed verification attempts are tracked per IP. After the configured threshold (CAPTCHA_MAX_FAILURES, default 5), the IP is temporarily blocked (CAPTCHA_BLOCK_DURATION_SECONDS, default 15 minutes).
  • Blocked IPs cannot obtain a nonce until the block expires. Provider outages fail closed with HTTP 503 and never issue a nonce.
  • A nonce is issued only after the provider returns success: true.

Closes #77

Tests

  • Successful provider verification
  • Invalid tokens
  • Repeated failures and temporary IP blocking
  • Provider failure / unexpected payload (no nonce)
  • Nonce issuance only after CAPTCHA success

Made with Cursor

Gate nonce issuance on server-side provider verification and temporarily
block IPs after repeated failed attempts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Goodnessukaigwe Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[Backend] Create CAPTCHA verification for auth nonce requests

1 participant