Skip to content
Business logic Write-up Beginner

Coupon Code Leakage & Response Manipulation got me 40% discount in a self hosted bug bounty company : A Real-World Case Study in self hosted bug bounty program

A food-ordering platform accepted expired coupon codes because coupon validity was decided in the browser response rather than on the server. An attacker could edit the response to mark an expired coupon as valid and obtain an unauthorised discount.

Be nice insabat Follow

Published on medium.com

Assalam o alaikum for muslim brothers and hello for non muslims, i hope all of you are doing well and learning new things day by day.

Be nice insabat, 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 the application relied on client-side response data to decide coupon validity instead of enforcing the check on the backend.

Impact

Attackers could repeatedly obtain unauthorised discounts, causing financial loss and undermining trust in the platform.

What the attacker needed

A shopper account on the platform; a leaked or expired coupon code; ability to intercept and edit responses

The fix

Coupon validity should be enforced entirely on the server, with expired or inactive codes rejected there and rate limiting on attempts.

How it was found

  1. Add items to the cart and go to checkout.
  2. Enter the leaked coupon code in the coupon field.
  3. Intercept the server's response with a proxy tool.
  4. Change the validity flag and message in the response.
  5. Forward the modified response and observe the discount applied.

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.

When you type a coupon code, the website's server sends back a message saying whether it worked. Here the server's answer could be changed in transit by the person using the site, and the site then trusted that changed answer. So a shopper could turn a 'no' into a 'yes' and get a discount they were not entitled to.

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.

More by Be nice insabat

View all

8 more disclosed reports, best first.

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.