Course contentsShow
← Security
Lesson 922 of 3,05219. Web Security - Business Logic VulnerabilitiesFree lesson

Coupon and Discount Code Abuse

Attacking promotional systems through code reuse, brute-forcing, stacking restrictions, and redemption logic flaws.

Coupon and Discount Code Abuse

What you'll learn: How attackers manipulate promotional code systems to gain unauthorized discounts or financial benefits beyond what the business intended.


The Core Problem

Many web applications offer promotional codes, discount coupons, or referral systems to attract customers. When these systems lack proper validation and business logic controls, attackers can exploit them to:

  • Reuse single-use codes multiple times
  • Brute-force valid coupon codes through enumeration
  • Stack multiple restrictions that should be mutually exclusive
  • Bypass redemption limits meant to prevent abuse

These flaws sit firmly in the business logic domain—they're not traditional injection vulnerabilities, but rather misunderstandings about how users might manipulate intended workflows.


Common Attack Patterns

Code Reuse: A "single-use" coupon code that isn't properly invalidated after redemption can be applied repeatedly, either by the same user or shared publicly.

Brute-Forcing: Short, predictable codes (like SAVE10, WELCOME2024) can be guessed. Attackers automate requests to discover valid codes not meant for them.

Stacking Restrictions: Applying multiple coupons when business rules should limit to one, or combining incompatible discounts (e.g., "new customer" + "VIP loyalty" simultaneously).

Redemption Logic Flaws: Manipulating the order of operations—applying a discount before taxes versus after, or exploiting timing windows where validation occurs separately from actual discount application.


Real-World Impact

Think of it like a physical store cashier who doesn't mark used coupons—customers could clip one coupon from the newspaper and use it at every checkout forever. Digital systems need equivalent "marking" mechanisms that attackers can't bypass through session manipulation or concurrent requests.

Key Takeaway: Promotional code systems require strict server-side validation of uniqueness, eligibility rules, expiration, and mutual exclusivity—never trust client-side discount calculations or rely solely on code complexity for security.