Most indie Discord license bots start as a 60-line script: accept a JSON webhook from Stripe or Gumroad, generate crypto.randomUUID() , store it in a JSON file, and grant a VIP role when someone runs /redeem .
Within a week of real traffic, four abuse vectors show up:
Forged webhook requests: Anyone who discovers your /webhook endpoint can POST a fake sale payload and mint unlimited keys.
Timing side-channels & parsed-JSON re-serialization bugs: Comparing signatures with === leaks byte-level timing, and verifying an HMAC over JSON.stringify(req.body) breaks when whitespace or key order differs from the raw payload.
Key sharing across 20 Discord accounts: Without atomic seat-cap binding, one leaked key gets redeemed by an entire server.
Chargeback buyers keeping VIP roles forever: If your webhook only listens for payment.succeeded and ignores charge.refunded / charge.dispute.created , refunded buyers keep gated channels permanently.
Here is a zero-trust architecture using node:crypto , discord.js v14,…