I made online store to pay for my orders and get me free refunds.
The online store's payment and wallet system mishandled concurrent order attempts, allowing the author to place orders that were effectively paid for by the store and to obtain extra refunds in their cash wallet. The author exploited race conditions and a forced COD order to create negative balances that the server later reset, crediting the account with more funds than it should have.
Published on medium.com
In this blog, I am going to show how I made a popular online store to pay for my wallet balance and how I got free refunds in my account without ordering any item.
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 did not properly synchronise concurrent order placement and wallet deduction operations, allowing multiple orders to be created with the same wallet balance and leading to negative balances that were later incorrectly reset.
Impact
The author could make the store pay for orders and obtain extra refunds in their cash wallet, potentially leading to financial loss for the store.
What the attacker needed
A user account with wallet balance; ability to place orders; concurrent requests
How it was found
- Add two identical items to the cart and apply the available cash amount to reduce the total.
- Proceed to checkout and attempt payment with a debit/credit card, which fails with an undefined error.
- Retry the card payment, then complete the order using UPI for the remaining amount.
- Observe that multiple orders were created, including pending ones that used wallet credit and cash, resulting in negative wallet balances.
- Place a new order using cash on delivery (COD) despite the negative balance, then cancel it after confirmation.
- Observe that the server resets the account and credits back the initial wallet amounts, effectively paying for the order and providing extra funds.
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 is when a website processes multiple actions at nearly the same time and gets confused, leading to incorrect results. Here, the store's wallet and order system did not properly handle overlapping payment attempts, so the author could make the store pay for orders and even get extra money back. This is a business logic flaw where the application's rules for money and orders can be bypassed.
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.