How I Bought a ₹4999 Course for Just ₹1 Using a Simple Logic Bug
The course purchase request carried the price in a client-controlled, merely encoded field, and the server accepted the tampered value without checking it against the course. An attacker could enrol in any paid course for a token amount instead of the real price.
Published on anupamas02.medium.com
While browsing a learning platform one morning, I noticed something strange while testing the course purchase flow. It eventually led to one of the most straightforward but critical bugs I’ve ever found: I was able to buy a paid course worth ₹4999 for just ₹1.
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 trusted a client-supplied price field instead of looking up the course price itself, and the encoding gave a false sense of protection.
Impact
Anyone could buy any premium content for a token amount, which could have caused serious financial damage to the platform.
What the attacker needed
A user account on the platform; an intercepting proxy; a paid course to target
The fix
The price should be fetched only on the server from the course identifier, the client should never control it, and any encoded data should be signed to prevent tampering.
How it was found
- Click Enroll on a paid course.
- Capture the resulting request in an intercepting proxy.
- Decode the request body from hex and then from base64 to reveal JSON.
- Change the price value in the JSON to a much smaller amount.
- Re-encode the body back to base64 and then hex.
- Replace the request body with the modified version and forward it.
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 buy something online, the price should be decided by the shop's computer (the server), not by your browser. Here the browser sent the price along with the order, hidden only by encoding, which is like wrapping a note in a different envelope rather than locking it. The server trusted that note, so changing it let the buyer set their own price.
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.