How Race Condition Worth Me $1000 On YesWeHack
A GraphQL endpoint that issues coupons could be abused with a race condition to redeem the same coupon multiple times, exceeding the intended limit. An attacker could obtain more coupons than allowed, potentially for financial gain.
medium.com
Published on medium.com
The scope of that program was narrow. So, i thought i should focus on Android Testing.
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 redemption logic lacked atomicity, allowing concurrent requests to each pass the single-use check before any marked the coupon as used.
Impact
The attacker could redeem a coupon more times than allowed, obtaining extra coupons; the company initially rated it high severity but reduced it to medium after the attacker could not bypass RASP on the protected app.
What the attacker needed
Access to the mobile app; ability to intercept HTTP traffic; a coupon with a redemption limit
How it was found
- Intercept the GraphQL request sent when clicking the Redeem button.
- Send the request to Turbo Intruder and select the race-single-packet-attack script.
- Launch the attack to send multiple requests simultaneously.
- Observe multiple different coupon IDs in the responses.
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 system checks a limit but doesn't lock it, so sending many requests at once can slip past the check. Here, the app allowed redeeming a coupon only once, but by firing many requests simultaneously, the attacker got multiple coupons. This is like a store clerk checking a coupon and marking it used, but if you hand over many copies at the exact same moment, they all get accepted.
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.