Skip to content

Fraud Protection & Rate Limiting

Code SCE implements multi-tiered rate limiting and behavioral anomaly detection to mitigate distributed denial-of-service (DDoS) attacks, brute-force attempts, payment invoice spam, and catalog scraping.

The overarching design principle: Protective limits are generous for legitimate human developers, and fraud controls never disrupt an honest checkout or valid download.

Multi-Tiered Rate Limiting

Code SCE enforces rate limiting at multiple levels of the Express middleware stack:

Limiter TierWindowMax RequestsScope & Protection
Global Rate Limiter15 minutes150 requestsApplied across all API routes to mitigate general traffic floods. Health check /health and preflights are exempt.
Auth Rate Limiter15 minutes30 requestsStrict limiter applied to authentication callbacks, provider linking, and disconnect endpoints to prevent brute-force attacks.
Download Limiter1 minuteDynamic burstApplied to signed token generation and secure file streaming endpoints.
Messaging Limiter1 minuteDynamic burstApplied to peer-to-peer message creation to prevent automated chat flooding.

When any threshold is exceeded, the server responds with HTTP 429 Too Many Requests and a standard Retry-After header.

Purchase & Invoice Abuse Defenses

Applied when generating payment invoices via NOWPayments:

  • Rapid Invoicing per Account: Excessive invoice creation within seconds triggers a cooldown.
  • Per-IP Invoice Windows: Broad per-IP thresholds prevent account-rotation bots from spamming checkout sessions.
  • Payment Failure Counters: Repeated failed or expired invoices (characteristic of card-testing or automated probing) pause checkout capabilities temporarily. A single successful payment resets the failure counter.

Download & Content Protection

Applied when generating signed download links after ownership has been verified:

  • Volume Ceilings: Protects against automated catalog harvesting.
  • Distinct Module Thresholds: Rapidly requesting downloads for dozens of different modules in a short time window triggers a temporary hold.
  • Unpenalized Re-downloads: Re-downloading your own previously purchased module is never penalized.

Multi-IP Network Anomaly Monitoring

If a single account attempts downloads simultaneously from multiple geographic IP ranges within minutes, the activity is flagged and logged for audit review (with sensitive tokens sanitized per CWE-532). The platform deliberately avoids hard-blocking on IP switching alone, ensuring developers on VPNs, mobile hotspots, or dynamic corporate networks experience uninterrupted access.

Fail-Open Resilience

All fraud monitoring and rate-limiting components are designed to be fail-open: if a caching or tracking store (such as Redis) experiences temporary unavailability, the system falls back to safe in-memory defaults rather than rejecting valid user requests.

Next Step

See how transactions are verified on-chain: Payment Verification →.

Built for developers who ship.