Coupon and Reward Abuse

A business logic flaw where single-use or limited-value incentives (discount codes, gift cards, referral bonuses, loyalty points, refunds) can be redeemed more than once, stacked, forged or self-issued, because the server doesn’t enforce the “once” and “how much” rules atomically.

How it works

Every incentive has a quota invariant: one redemption per code, one discount per order, one bonus per real referral, refund ≤ amount paid. Ways it fails:

PatternBroken invariantSource
Stacking across channelsThe same discount applied via web, API and mobile, each path checking only itself, until the price reaches $0Backend Mastery
Limit-overrun raceCheck-then-mark is not atomic, so parallel redemptions all pass the checkAPI Pentesting guide, Race condition auth bypass
Refund double-spendRefund and re-purchase interleave, so the balance is credited twice while the purchase stays validBackend Mastery
Referral / reward farmingRewards keyed to cheap identities, or signed with no real secretCommon Bug Bounty Vulnerabilities, Civic reward backend
AI agent as issuerA support agent grants refunds or cites discounts based on attacker-controlled contextHacking AI customer service agents

Testing heuristics

  • Inventory every incentive endpoint (validate-coupon, redeem, referral, points, refund) and write down its intended quota.
  • Re-apply the same incentive across channels, sessions and accounts, and in combination with others, then check the server-side order total (Backend Mastery).
  • For single-use resources, test concurrent redemption (Turbo Intruder or a simple threaded client) and compare the final balance with the expected one (API Pentesting guide, Mastery Hunt).
  • Check what the quota is keyed to (account, device, IP, timezone day) and whether that key is cheap to rotate. Shared resources and referral systems are common rate-limit bypass paths (Backend Mastery).
  • Check whether reward requests are signed, and whether the signing secret is actually secret. In the civic-app case, a public salt and an HMAC key served by an init endpoint made reward campaigns forgeable across every tenant (Civic reward backend, see Hardcoded Secrets).
  • If an LLM agent can issue refunds or quote promotions, test whether untrusted content can steer it: forged “internal approval” threads, or RAG-indexed forum comments advertising non-existent promo codes (Hacking AI customer service agents, see Indirect Prompt Injection).

Notable cases

  • In Chinese civic apps, the reward and lottery backend runs on shared multi-tenant SaaS with no real signing secret. Daily sign-in, quiz and sweepstakes rewards were farmed by scripts and cashed out to Alipay (Civic reward backend).
  • An AI customer-service agent accepted a spoofed approval thread and issued a $4,200 refund (Hacking AI customer service agents).
  • Coupon stacking and refund race scenarios are presented as the bugs “companies fear most” (Backend Mastery).

Defenses

  • Redeem atomically: one conditional update or unique constraint (UPDATE ... WHERE used = false), not a read followed by a write.
  • Use idempotency keys and step tokens on payout, gift-card and refund flows, plus velocity rules per user, device and ASN. Run bulk operations as quota-limited async jobs (OWASP API Top 10 guide with tests).
  • Enforce one discount policy server-side for all channels, and recompute totals at commit time (Price and Quantity Manipulation).
  • Keep signing keys server-side and per tenant. Never derive request integrity from values the client can obtain.
  • Don’t let an LLM agent be the authority for money movement. Require out-of-band approval and cross-check cited sources (Hacking AI customer service agents).
  • Edge or WAF schema validation helps against cart and coupon fraud only as a supplement (Protecting Payment, Cart, and Login Endpoints).

Sources