Skip to content
IDOR Write-up Beginner

Insecure Direct Object Reference (IDOR) — Unauthorized Product Price Modification

The product update request identified the product only by an id parameter and did not check that the caller owned it, so an attacker could swap in another seller's product id and change that product's price. The attacker could then buy expensive items at a price they had set themselves.

mo.muwafak2001 Follow

Published on medium.com

Idor

MUWAFAK HELAL, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

The target is a worldwide buy-and-sell marketplace, a platform where users publish products and other users buy them. Publishing or updating a product is a single request that carries the product data, including the price. The product being acted on is identified by an id parameter inside that request.

The feature under review is product update: the same request that a seller uses to publish or change their own listing. The researcher found that this request can be replayed and that the id inside it is trusted on its own, so the price of any product on the platform can be changed, including products the requester does not own.

Setup

The application implements strong anti-proxy protections and actively blocks Burp Suite. To intercept traffic without being detected, the researcher used an older version of mitmproxy. The report does not name the version, the accounts used, or the roles involved beyond the fact that a user can publish and update products.

Finding it

While working with the product publish and update flow, the researcher noticed two things:

  1. The price is included in the same request as the rest of the product data, both when publishing and when updating a product.
  2. The application allows that request to be replayed, and product data can be modified by changing parameters in it.

The product is identified solely by an id parameter inside the request. Nothing in the request ties the operation to the authenticated owner, and the application does not properly verify ownership or authorisation when the id is modified. That combination is what makes the replay interesting: if the id is the only thing selecting the target object, then changing it should select a different object, and the server appears to accept that.

Exploitation

To exploit the issue, the attacker first needs the target product's ID. When requesting information about any product, for example by viewing a product page, the server returns the product's id in the response. That makes it easy to collect the ID of any product on the platform.

The exploitation flow is:

  1. Browse or search for a target product.
  2. Capture the product information request and extract the product id from the response. (Test3)
  3. Replay the product update request, replacing the original id with the target product's id and modifying the price.
  4. The price of the target product is successfully updated.
  5. The attacker can then purchase the product at the newly modified (lower) price.

Step 1: Find a target product

Browse or search the marketplace for the product whose price should be changed. Any listed product works, because the next step only needs its identifier.

Step 2: Capture the product information request and extract the id

The product information request, the one issued when viewing a product page, returns the product's id in the response body. The researcher labels this capture Test3. The ID is taken straight from that response and used as the target in the next step.

Step 3: Replay the update request with the target id and a new price

The product update request is replayed with two changes: the original id is replaced by the target product's id, and the price is modified. The report does not reproduce the raw request, so the exact endpoint, method, headers and body are not shown here.

42439 (test2) → 42438 (test3). From the original on medium.com

The image caption reads: 42439 (test2) to 42438 (test3).

Step 4: Confirm the price change

The report states that the price of the target product is successfully updated.

From the original on medium.com

The image follows the step in which the target product's price is successfully updated.

Step 5: Buy at the new price

With the price changed, the attacker can purchase the product at the newly modified, lower price.

Root cause

The product is identified solely by an id parameter inside the request, and the application does not properly verify ownership or authorisation when that id is modified. The server accepts the replayed update request and applies the new data, including the price, to whatever product the supplied id points to. This is a Broken Access Control issue: the object reference is direct and the access check that should bind the object to the authenticated user is missing or ineffective.

The anti-proxy protections blocked Burp Suite, which is why an older version of mitmproxy was used to intercept traffic without being detected.

Impact

  • Change the price of any product on the platform without authorisation.
  • Lower the price of expensive items and purchase them at a fraction of the original cost.
  • Cause financial loss to legitimate sellers.
  • Disrupt the integrity of the marketplace pricing system.

The researcher describes this as a clear Broken Access Control issue with direct financial impact. The attack needs the target product's ID, which the platform itself discloses in product information responses.

Fix

The report does not state what was changed. The fix implied by the root cause is to enforce an ownership and authorisation check on the server for every product update: the id in the request must be verified against the authenticated user before any field, including the price, is written.

Variants to test

  • Other object identifiers in the same request. If the update request carries more than the product id, try swapping each identifier for one belonging to another user and check whether the response reflects the change. A positive result is a successful update to an object you do not own.
  • Other write operations on the same object. Apply the same replay with a swapped id to delete, archive or status-change requests. A positive result is the target product disappearing or changing state without the owner acting.
  • Price fields in other flows. Test whether the price can be changed through other requests that carry it, such as cart or checkout operations. A positive result is a price the seller never set being accepted at purchase time.
  • Identifier enumeration in read responses. Check whether product information responses expose identifiers for objects that are not otherwise linked to the requester, as they did here. A positive result is a stable identifier you can feed into the write request.
  • Replay after logout or with a different session. Replay the captured update request with a session that does not own the product. A positive result is the update still being applied.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

A security researcher was looking at a large online marketplace, a website where people from all over the world put goods up for sale and other people buy them. Think of it like a huge classified ads site: sellers create listings, buyers browse them, and money changes hands.

When a seller creates or edits a listing, their browser sends a message to the website's server. That message contains all the details of the product, including its price. The website uses a number called an id to know which product the message is about. Every product has its own id, a bit like a house number on a street: it is how the server finds the right door.

The researcher found that the server trusted that id completely. If you took a legitimate "update my product" message and swapped the id for the id of somebody else's product, the server would happily update that other product instead, including its price. The server never checked whether the person sending the message actually owned the product they were changing.

This kind of mistake has a name: Insecure Direct Object Reference, or IDOR. "Direct object reference" means the request points at a thing (an object) using a simple identifier, here the product id. "Insecure" means the server does not check that you are allowed to touch the thing you pointed at. A useful everyday comparison: imagine a hotel where your room key is just the room number written on a card. If the front desk never checks that the number on the card matches the guest, anyone can write "214" on a card and walk into room 214. The number is a direct reference to the room, and nothing verifies that you belong there.

Because the price could be changed, the researcher could lower the price of an expensive item and then buy it at the new, much cheaper price. The seller loses money, and the marketplace's prices can no longer be trusted.

The target and the feature

The target is a worldwide buy-and-sell marketplace. Users publish products, and other users buy them.

Publishing a product and updating a product are each a single request that carries the product data, including the price. A request here means one message your browser sends to the website's server, for example "save this listing with this title and this price". The feature under review is product update: the same request a seller uses to publish or change their own listing.

The researcher found that this request can be replayed. Replaying means sending exactly the same message again, or sending it again with small edits, instead of letting the browser compose a fresh one. The researcher also found that the id inside the request is trusted on its own. So the price of any product on the platform can be changed, including products the person sending the request does not own.

Setting up the tools

To study the messages, the researcher needed to see them. Normally a security tester uses a tool that sits between the browser and the website and records every request and response. Burp Suite is one such tool.

This application implements strong anti-proxy protections and actively blocks Burp Suite. A proxy is a middleman: traffic goes from your browser to the proxy, and the proxy forwards it to the website. The site apparently detects that middleman and refuses to work with it. To intercept traffic without being detected, the researcher used an older version of mitmproxy, another interception tool. The report does not name the version, the accounts used, or the roles involved beyond the fact that a user can publish and update products.

Finding it

While working with the product publish and update flow, the researcher noticed two things:

  1. The price is included in the same request as the rest of the product data, both when publishing and when updating a product.
  2. The application allows that request to be replayed, and product data can be modified by changing parameters in it.

A parameter is simply a named value inside a request, like id=42439 or price=100. Changing a parameter changes what the server is being asked to do.

The product is identified solely by an id parameter inside the request. Nothing in the request ties the operation to the logged-in owner, and the application does not properly verify ownership or authorisation when the id is modified. Authorisation means checking whether this particular user is allowed to do this particular thing. That combination is what makes the replay interesting: if the id is the only thing selecting the target object, then changing it should select a different object, and the server appears to accept that.

Exploitation

To exploit the issue, the attacker first needs the target product's ID. When requesting information about any product, for example by viewing a product page, the server returns the product's id in the response. That makes it easy to collect the ID of any product on the platform.

The exploitation flow is:

  1. Browse or search for a target product.
  2. Capture the product information request and extract the product id from the response. (Test3)
  3. Replay the product update request, replacing the original id with the target product's id and modifying the price.
  4. The price of the target product is successfully updated.
  5. The attacker can then purchase the product at the newly modified (lower) price.

Step 1: Find a target product

Browse or search the marketplace for the product whose price should be changed. Any listed product works, because the next step only needs its identifier. This step is just normal shopping behaviour: open the site, look around, pick something expensive.

Step 2: Capture the product information request and extract the id

When you open a product page, your browser asks the server for that product's information. The server answers with the product's details, and that answer includes the product's id. The researcher labels this capture Test3. The ID is taken straight from that response and used as the target in the next step.

Why this step matters: the site itself returns the product's id whenever a product page is viewed, so the identifier is easy to collect.

Step 3: Replay the update request with the target id and a new price

The product update request is replayed with two changes: the original id is replaced by the target product's id, and the price is modified. The report does not reproduce the raw request, so the exact endpoint, method, headers and body are not shown here. An endpoint is the address the request is sent to; the method is the kind of action, such as reading or writing; headers are extra labels attached to the message; the body is the content, here the product data.

42439 (test2) → 42438 (test3). From the original on medium.com

The image caption reads: 42439 (test2) to 42438 (test3).

In plain words: the researcher sent the update message again with the number changed from 42439 to 42438, the target product, plus a different price.

Step 4: Confirm the price change

The report states that the price of the target product is successfully updated.

From the original on medium.com

The image follows the step in which the target product's price is successfully updated.

Step 5: Buy at the new price

With the price changed, the attacker can purchase the product at the newly modified, lower price.

Root cause

The product is identified solely by an id parameter inside the request, and the application does not properly verify ownership or authorisation when that id is modified. The server accepts the replayed update request and applies the new data, including the price, to whatever product the supplied id points to. This is a Broken Access Control issue: the object reference is direct and the access check that should bind the object to the logged-in user is missing or ineffective.

Broken Access Control is the general name for this family of mistakes: the site knows who you are, but fails to check what you are allowed to do. The anti-proxy protections blocked Burp Suite, which is why an older version of mitmproxy was used to intercept traffic without being detected.

Impact

  • Change the price of any product on the platform without authorisation.
  • Lower the price of expensive items and purchase them at a fraction of the original cost.
  • Cause financial loss to legitimate sellers.
  • Disrupt the integrity of the marketplace pricing system.

The researcher describes this as a clear Broken Access Control issue with direct financial impact. The attack needs the target product's ID, which the platform itself discloses in product information responses.

Fix

The report does not state what was changed. The fix implied by the root cause is to enforce an ownership and authorisation check on the server for every product update: the id in the request must be verified against the logged-in user before any field, including the price, is written. In hotel terms: the front desk must check that the card really belongs to the guest before the door opens.

Variants to test

  • Other object identifiers in the same request. If the update request carries more than the product id, try swapping each identifier for one belonging to another user and check whether the response reflects the change. A positive result is a successful update to an object you do not own.
  • Other write operations on the same object. Apply the same replay with a swapped id to delete, archive or status-change requests. A positive result is the target product disappearing or changing state without the owner acting.
  • Price fields in other flows. Test whether the price can be changed through other requests that carry it, such as cart or checkout operations. A positive result is a price the seller never set being accepted at purchase time.
  • Identifier enumeration in read responses. Check whether product information responses expose identifiers for objects that are not otherwise linked to the requester, as they did here. A positive result is a stable identifier you can feed into the write request.
  • Replay after logout or with a different session. Replay the captured update request with a session that does not own the product. A positive result is the update still being applied.

Glossary

  • API: the set of addresses and rules a website uses to exchange data with a browser or app, so one program can ask another to do something.
  • Authorisation: the check of whether a logged-in user is allowed to perform a specific action on a specific thing.
  • Body: the content part of a request or response, such as the product data being saved.
  • Broken Access Control: a class of bug where the site knows who you are but fails to check what you are allowed to do.
  • Burp Suite: a tool that sits between browser and website to record and edit requests.
  • Cookie: a small piece of data the site stores in your browser so it can recognise you on later requests.
  • Endpoint: the address a request is sent to.
  • Header: an extra label attached to a request or response, carrying metadata rather than content.
  • IDOR (Insecure Direct Object Reference): a bug where a request names a thing by a simple identifier and the server does not check that you are allowed to access that thing.
  • id parameter: the named value in a request that tells the server which product is meant.
  • Method: the kind of action a request asks for, such as reading or writing.
  • mitmproxy: a tool that sits between browser and website to record and edit requests, like Burp Suite.
  • Parameter: a named value inside a request, such as id=42439.
  • Proxy: a middleman that traffic passes through on its way to the website.
  • Replay: sending a captured request again, possibly with small edits, instead of composing a new one.
  • Request: one message your browser sends to a website's server.
  • Response: the server's answer to a request.
  • Session: the site's record of your logged-in visit, usually tied to a cookie or token.
  • Token: a value that proves who you are to the site, similar in purpose to a cookie.

More by mo.muwafak2001

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

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.