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:
| Pattern | Broken invariant | Source |
|---|---|---|
| Stacking across channels | The same discount applied via web, API and mobile, each path checking only itself, until the price reaches $0 | Backend Mastery |
| Limit-overrun race | Check-then-mark is not atomic, so parallel redemptions all pass the check | API Pentesting guide, Race condition auth bypass |
| Refund double-spend | Refund and re-purchase interleave, so the balance is credited twice while the purchase stays valid | Backend Mastery |
| Referral / reward farming | Rewards keyed to cheap identities, or signed with no real secret | Common Bug Bounty Vulnerabilities, Civic reward backend |
| AI agent as issuer | A support agent grants refunds or cites discounts based on attacker-controlled context | Hacking AI customer service agents |
- Race-condition write-ups use gift-card redemption as the standard limit-overrun example: one thread checks the card’s status while another marks it used (Race condition auth bypass, NahamSec: top vulnerabilities 2025). Mechanics belong to Race Conditions.
- Referral bonuses and crypto withdrawals are named as places where a race becomes a critical finding (Common Bug Bounty Vulnerabilities). Bitvulnex includes concurrent staking-reward claims as a training exercise (Bitvulnex).
- At scale this is OWASP API6:2023, Unrestricted Access to Sensitive Business Flows: a legitimate flow (ticket purchase, gift-card or payout issuance) automated past the business’s tolerance, often with no implementation bug at all (OWASP API Security Project, OWASP API Top 10 guide with tests).
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).
Related
- Business Logic Vulnerabilities (main guide)
- Price and Quantity Manipulation · Workflow and State Bypass · Paywall and Entitlement Bypass
- Race Conditions · API Rate Limiting · OWASP API Security Top 10 · Turbo Intruder · RAG Poisoning
Sources
- Backend Mastery: The Real Bug Bounty Superpower (2026) · original
- API Penetration Testing: Complete Guide · original
- Race Condition Authentication Bypass: Full Account Takeover · original
- Common Bug Bounty Vulnerabilities: A Technical Deep Dive · original
- Multiple Chinese civic apps share one reward/lottery backend · original
- Hacking AI customer service agents · original
- Top Vulnerabilities for Pentest & Bug Bounty in 2025 · original
- Bitvulnex: a vulnerable crypto exchange · original
- OWASP API Security Project · original
- OWASP API Security Top 10 (2025) Guide with Tests · original
- Mastery Hunt: Hidden API Endpoints · original
- Protecting Payment, Cart, and Login Endpoints at the Edge · original
- Bug Bounty Hunting in 2026 · original