# 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 | [[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601\|Backend Mastery]] | | Limit-overrun race | Check-then-mark is not atomic, so parallel redemptions all pass the check | [[raw/nflo.tech/api-penetration-testing-complete-guide-4321\|API Pentesting guide]], [[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362\|Race condition auth bypass]] | | Refund double-spend | Refund and re-purchase interleave, so the balance is credited twice while the purchase stays valid | [[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601\|Backend Mastery]] | | Referral / reward farming | Rewards keyed to cheap identities, or signed with no real secret | [[raw/redfoxsec.com/common-bug-bounty-vulnerabilities-a-technical-deep-dive-for-hunters-in-4902\|Common Bug Bounty Vulnerabilities]], [[raw/neurowinter.com/multiple-chinese-civic-apps-share-one-reward-lottery-backend-whose-sig-10562\|Civic reward backend]] | | AI agent as issuer | A support agent grants refunds or cites discounts based on attacker-controlled context | [[raw/intigriti.com/hacking-ai-customer-service-agents-11941\|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 ([[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|Race condition auth bypass]], [[raw/nahamsec.com/top-vulnerabilities-for-pentest-bug-bounty-in-2025-4269|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 ([[raw/redfoxsec.com/common-bug-bounty-vulnerabilities-a-technical-deep-dive-for-hunters-in-4902|Common Bug Bounty Vulnerabilities]]). Bitvulnex includes concurrent staking-reward claims as a training exercise ([[raw/blazeinfosec.com/bitvulnex-a-vulnerable-crypto-exchange-12213|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 ([[raw/owasp.org/owasp-api-security-project-owasp-foundation-2713|OWASP API Security Project]], [[raw/qodex.ai/owasp-api-security-top-10-2025-guide-with-tests-3722|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 ([[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|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 ([[raw/nflo.tech/api-penetration-testing-complete-guide-4321|API Pentesting guide]], [[raw/infosecwriteups.com/mastery-hunt-hidden-api-endpoints-a-deep-dive-into-api-bug-bounty-reco-9391|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 ([[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|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 ([[raw/neurowinter.com/multiple-chinese-civic-apps-share-one-reward-lottery-backend-whose-sig-10562|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 ([[raw/intigriti.com/hacking-ai-customer-service-agents-11941|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 ([[raw/neurowinter.com/multiple-chinese-civic-apps-share-one-reward-lottery-backend-whose-sig-10562|Civic reward backend]]). - An AI customer-service agent accepted a spoofed approval thread and issued a $4,200 refund ([[raw/intigriti.com/hacking-ai-customer-service-agents-11941|Hacking AI customer service agents]]). - Coupon stacking and refund race scenarios are presented as the bugs "companies fear most" ([[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|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 ([[raw/qodex.ai/owasp-api-security-top-10-2025-guide-with-tests-3722|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 ([[raw/intigriti.com/hacking-ai-customer-service-agents-11941|Hacking AI customer service agents]]). - Edge or WAF schema validation helps against cart and coupon fraud only as a supplement ([[raw/tencentcloud.com/protecting-payment-cart-and-login-endpoints-at-the-edge-3026|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 - [[raw/medium.com/backend-mastery-the-real-bug-bounty-superpower-2026-3601|Backend Mastery: The Real Bug Bounty Superpower (2026)]] - [[raw/nflo.tech/api-penetration-testing-complete-guide-4321|API Penetration Testing: Complete Guide]] - [[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|Race Condition Authentication Bypass: Full Account Takeover]] - [[raw/redfoxsec.com/common-bug-bounty-vulnerabilities-a-technical-deep-dive-for-hunters-in-4902|Common Bug Bounty Vulnerabilities: A Technical Deep Dive]] - [[raw/neurowinter.com/multiple-chinese-civic-apps-share-one-reward-lottery-backend-whose-sig-10562|Multiple Chinese civic apps share one reward/lottery backend]] - [[raw/intigriti.com/hacking-ai-customer-service-agents-11941|Hacking AI customer service agents]] - [[raw/nahamsec.com/top-vulnerabilities-for-pentest-bug-bounty-in-2025-4269|Top Vulnerabilities for Pentest & Bug Bounty in 2025]] - [[raw/blazeinfosec.com/bitvulnex-a-vulnerable-crypto-exchange-12213|Bitvulnex: a vulnerable crypto exchange]] - [[raw/owasp.org/owasp-api-security-project-owasp-foundation-2713|OWASP API Security Project]] - [[raw/qodex.ai/owasp-api-security-top-10-2025-guide-with-tests-3722|OWASP API Security Top 10 (2025) Guide with Tests]] - [[raw/infosecwriteups.com/mastery-hunt-hidden-api-endpoints-a-deep-dive-into-api-bug-bounty-reco-9391|Mastery Hunt: Hidden API Endpoints]] - [[raw/tencentcloud.com/protecting-payment-cart-and-login-endpoints-at-the-edge-3026|Protecting Payment, Cart, and Login Endpoints at the Edge]] - [[raw/dev.to/bug-bounty-hunting-in-2026-dev-community-3605|Bug Bounty Hunting in 2026]]