Finding and Exploiting an Unused API Endpoint
An API endpoint that returns product prices also accepted PATCH requests, letting an authenticated user change the price of any product. The attacker set the jacket's price to zero and bought it for free.
meetcyber.net
Published on meetcyber.net
The target application provides an e-commerce workflow where users can log in and purchase products. The objective is to buy a Lightweight l33t Leather Jacket, originally priced at $1337.
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 pricing endpoint exposed a state-changing PATCH method without proper authorisation or server-side price validation.
Impact
Attackers could buy high-value items at zero cost, causing direct financial loss and potentially manipulating inventory or discounts.
What the attacker needed
A free account; Burp Suite
How it was found
- Log in and add the jacket to the cart.
- Find the price request in Burp HTTP history and send it to Repeater.
- Send an OPTIONS request to see allowed methods; GET and PATCH are listed.
- Change the method to PATCH and add a JSON content type header.
- Convert the body to JSON and add a price parameter set to zero.
- Send the request, then add the jacket to the cart again and check out for free.
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 shop's website asks a server for a product's price. That same server address also allowed a different kind of request that changes data, not just reads it. Because the server did not check who was allowed to change prices, the attacker told it the jacket cost nothing and then bought it.
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.