Skip to content
Business logic Write-up Beginner

Reusing a One-Time Coupon Code Multiple Times (Business Logic Bug)

A welcome coupon intended for one-time use per customer was accepted repeatedly by the checkout system. An attacker could place many discounted orders with the same voucher, causing financial loss to the platform.

tarekmohamed0106 Follow

Published on medium.com

While testing an e-commerce website as part of a bug bounty program, I came across an interesting business logic issue related to promotional vouchers. At first it looked like normal coupon functionality, but after testing the checkout flow more carefully, I noticed that the system allowed something that shouldn’t…

Tarek Mohamed (0x_tarek), on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely missing server-side validation: the backend does not track whether a coupon has already been redeemed by the same account.

Impact

An attacker could repeatedly place discounted orders with the same voucher, and if the technique spreads, multiple users could cause noticeable revenue loss for the platform.

What the attacker needed

A customer account; access to the checkout flow; a coupon intended for one-time use

The fix

The backend should track coupon redemption in the database and prevent the same account from using the voucher more than once, with additional checks such as limiting usage per email address or payment method.

How it was found

  1. Add products to the cart and apply the welcome coupon during checkout.
  2. Complete the first order with the discount applied.
  3. Create a second order using the same account and apply the same coupon again.
  4. Repeat the process to confirm the coupon is accepted on every new order.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A coupon is a discount code. The shop said this welcome code could only be used once per customer, but the website never actually checked or remembered that the code had already been used. So the same person could keep typing the code on new orders and get the discount every time.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.