How I was able to buy 2500 Rs product for 18rs in E-Commerce Website?
The e-commerce site deducted wallet credit before an order was confirmed, so failed card payments left pending orders that still consumed the wallet balance. By placing multiple orders concurrently, the attacker could apply the same wallet credit more than once and buy products for far less than their price.
Published on medium.com
In this blog, I will explain the race condition or a concurrency-related vulnerability that caused me to buy the product at minimum price from e-commerce store. I came across a popular e-commerce website which hosted clothing products.
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 deducted wallet balance at order creation rather than only after payment confirmation, allowing concurrent or failed orders to reuse the same credit.
Impact
An attacker could obtain products for much less than their listed price by reusing wallet credit across failed or concurrent orders, and the wallet could be driven negative.
What the attacker needed
A user account with wallet credit; ability to submit multiple payment attempts; a payment method that can fail or be retried
How it was found
- Add two identical items worth Rs 1259 each to the cart so the total after wallet deduction is Rs 18.
- Choose Debit/Credit Card and submit payment; the application shows an undefined error and creates a pending order.
- Repeat the card payment attempt, creating a second pending order.
- Pay the same cart using UPI for Rs 18, which confirms one order.
- Check My Orders and see two pending card orders plus one confirmed UPI order.
- Check My Wallet and see negative balances showing the wallet credit was applied multiple times.
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 race condition happens when a website handles several actions at the same moment and gets confused about the order they happen in. Here, the site took money from the user's store wallet before the payment had actually succeeded, so when a card payment failed the wallet was still charged. Repeating this let the same wallet credit be used again and again, so a large order could be paid with only a tiny amount.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.