How Trusting the Client Side Put an Entire Wallet at Risk
The payment confirmation endpoint reflected the amount parameter unsanitised, enabling reflected XSS in an authenticated session. Separately, the server trusted the client-supplied amount in the post-payment callback, so an attacker could change it to credit their wallet with money they never paid.
medium.com
Published on medium.com
The best bugs don’t always announce themselves. Sometimes you walk away from an endpoint convinced there’s nothing there and then you come back, spend 2 rupees, and walk away with unlimited money.
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 server credited the wallet using the amount from the client's post-payment request instead of fetching the verified amount from the payment gateway.
Impact
An attacker could credit their wallet with arbitrary amounts without paying, and the reflected XSS could steal cookies or hijack an authenticated account.
What the attacker needed
A test account with wallet access; ability to intercept HTTP requests; a small real payment to trigger the callback
The fix
The server should query the payment gateway's server-to-server API using the order ID to retrieve the verified amount and status, rather than trusting the client's callback.
How it was found
- Initiate a legitimate minimum payment through the payment gateway.
- Intercept the success callback containing the order ID, payment ID and amount.
- Change the amount to a much higher value.
- Forward the modified request to the server.
- Observe the wallet balance updated to the manipulated 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.
A website should never believe a number that the user's browser sends when money is involved. Here, after a small payment, the browser told the server how much had been paid, and the server simply believed it. By changing that number, the tester made the wallet show more money than was actually paid.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.