Exploiting Application Logic to Referral Code Disclosure
The referral code was meant to be shown only after a user placed their first order, but a profile endpoint returned it in a GET response without that condition. An attacker could obtain their own referral code early and potentially abuse the referral programme.
Published on vj0shii.github.io
The target was a food delivery application, there was a functionality of referral code to invite someone and get cashback for that in the wallet but the user only get the referral code after placing first order, i exploited application logic to get referral code without placing 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 profile endpoint returned the referral code in its response without checking whether the user had placed a first order.
Impact
An attacker could obtain their referral code without placing an order, potentially allowing abuse of the referral programme and financial loss to the business.
What the attacker needed
A user account
The fix
The profile endpoint should not return the referral code until the user has placed their first order.
How it was found
- Open the My Account tab and note the referral code popup.
- Capture the profile update request.
- Change the request method from PUT to GET and remove the body.
- Send the request and observe the referralCode in the response.
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 referral code is a code you share so friends can sign up and you both get a reward. The app was supposed to hide this code until you made your first order. The tester found that simply asking the profile page for data in a different way returned the code anyway.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.