Price Tampering due to Improper checks on applying Coupon
The coupon validation and payment flow allowed the same coupon to be used in two simultaneous orders, and the hash representing the coupon was not expired if the coupon number was already invalid. An attacker could obtain discounts on multiple orders using a single coupon, causing financial loss to the company.
Published on vj0shii.github.io
I was recently hunting on a target, which is a food ordering site and found a bug from which I can tamper price during food order
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 coupon validation and hash expiration logic did not properly enforce single-use, allowing the same coupon to be applied to multiple orders and the hash to remain valid after the coupon expired.
Impact
An attacker could obtain discounts on multiple orders using a single coupon, causing the company to lose money equal to the discount amount.
What the attacker needed
Ability to generate a coupon; ability to place an order
How it was found
- Generate a coupon of a desired amount.
- Open two tabs, add items to the cart, and proceed to payment in both.
- Apply the same coupon in both tabs; note that two different hashes are returned.
- Complete payment in one tab, then complete payment in the other tab; both payments succeed with the discount.
- Reuse the hash from the second request on another payment; it still works even after many requests.
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 code that gives you money off. The website checked the coupon when you applied it, but it did not stop you from using the same coupon twice at the same time. Also, a special code (called a hash) that proved the coupon was valid was not cancelled after use, so it could be reused again and again.
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.