Race condition leading to multiple refunds and cash re
A merchant platform checked a transaction's refundable balance and then sent the refund as separate steps, so firing many refund requests at once let more money be returned than was ever paid. A support-level user could refund themselves far more than their purchase price, draining the store's cash.
medium.com
Published on medium.com
I was testing a merchant platform that allows you to setup your merchant account and sell your products the system had 3 roles:
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 balance check and the payout were not performed atomically, so concurrent requests all saw the same refundable balance before it was reduced.
Impact
A support user could obtain refunds far beyond what was paid, potentially draining the store's funds; the report notes the issue was a duplicate of an existing one.
What the attacker needed
A support-level merchant account; ability to place an order; send refund requests concurrently
How it was found
- Create a large order, around twenty thousand dollars.
- Log in with a support-level account that can issue refunds.
- Start a partial refund of five thousand dollars.
- Send many refund requests at the same time instead of one.
- Observe that the total refunded exceeds the original purchase amount.
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 ask for a refund, the site first checks how much money is left to give back, then sends it. If many requests arrive at the same moment, they can all pass the check before any of them updates the balance, so the site pays out several times. This is called a race condition: a timing problem where two actions overlap.
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.