Coupon and Discount Code Abuse

Detects discount/coupon code logic without per-user usage limits, allowing unlimited stacking or reuse.

zakirkun Updated

File contents

Coupon and Discount Code Abuse

Overview

Coupon systems without proper constraints allow:

  • Reusing a single-use coupon multiple times (no per-user tracking)
  • Stacking multiple coupons beyond allowed limits
  • Applying percentage-based coupons to items below minimum order value
  • Race-condition reuse: applying one coupon from multiple tabs simultaneously

Remediation

  • Track coupon usage per user in the database
  • Use database transactions with row-level locking for redemption
  • Validate minimum order value requirements server-side
  • Rate limit coupon attempts per user

zakirkun/ice-tea/tree/main/skills/business-logic/coupon-abuse commit 11ced4f4db

Frequently asked questions

npx skillmds@latest add zakirkun/coupon-and-discount-code-abuse