Decoding API Vulnerabilities: My Bug Bounty Saga on API Vulnerabi
An order-export API endpoint accepted a user-supplied user_id parameter without checking ownership, so changing it returned another user's order history. A separate profile-update endpoint likewise let the tester change other users' email addresses by altering user_id.
Published on osintteam.blog
While testing a popular e-commerce platform’s API, I noticed an endpoint /api/v1/order/export that allowed users to export their order history as a CSV file. On closer inspection, the userid parameter was exposed.
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 user-supplied identifier for the target account instead of deriving it from the authenticated session and checking ownership.
Impact
An attacker could read other users' order history and change other users' email addresses, which could lead to account takeover.
What the attacker needed
An account on the platform; ability to send crafted API requests
The fix
The server should enforce user-level access checks server-side and validate inputs so users cannot act on other accounts' identifiers.
How it was found
- Find the order-export endpoint that takes a user_id parameter.
- Send a request with a different user_id and observe another user's order data returned.
- Map API endpoints with an intercepting proxy to find related endpoints.
- Send a profile-update request with another user's user_id and a new email address.
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.
An API is the part of a website that apps talk to in the background. This one trusted a number the user sent to say whose orders to show, instead of checking who was logged in. By changing that number, the tester could read someone else's orders and even change their email address.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.