APPLICATION-SECURITY Contents

Abuse Prevention (Bots, Fraud, Enumeration)

Stop common abuse: enumeration, scraping, credential stuffing, and replay. Focus on detection signals and operational mitigations.

On this page

Common Abuse Patterns

  • Credential stuffing: many logins across many accounts
  • Enumeration: probing user existence via error differences
  • Scraping: high-volume reads and search abuse
  • Replay: resubmitting requests/webhooks to duplicate effects

Baseline Mitigations

  • Consistent error messages to reduce enumeration
  • Rate limit + progressive delays on auth flows
  • Idempotency keys for write operations
  • Device/session risk scoring for repeated failures
  • Captcha only as a last resort and only on high-risk flows

Detection Signals (Log What Matters)

Signals:
- auth.fail.count per ip and per user
- signup/reset attempts per ip
- 404/401/403 spikes
- repeated identical request payloads (replay)
- unusual user-agent churn

Replay Protection (Idempotency)

Write endpoint:
- Require Idempotency-Key header
- Store key + request hash + result for TTL
- If key seen: return stored result, do not re-execute

Operational Runbook

If abuse detected:
1) Enable stricter rate limits on affected routes
2) Block high-risk IP ranges (temporary) and monitor false positives
3) Turn on additional verification for targeted accounts
4) Investigate leaked credentials, rotate tokens/keys if needed
5) Add regression tests and alerts for the pattern