Skip to content
IDOR Write-up Beginner

Exploiting an IDOR to Claim Unavailable Free Gifts

The add-to-cart gift selection endpoint accepted any gift ID without checking eligibility, so an attacker could change the ID to claim an unavailable free gift. This let the attacker add a restricted gift to the cart and proceed to checkout.

scriptjacker Follow

Published on scriptjacker.medium.com

Hey Hackers, I am Parth Narula. A penetration tester, bug hunter, red teamer and overall a security researcher.

Parth Narula, on scriptjacker.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.

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 did not validate that the submitted gift ID belonged to the set of gifts eligible for the user's cart.

Impact

An attacker could claim any free gift, including unavailable or premium items, and proceed to checkout, potentially causing financial loss to the business.

What the attacker needed

A user account; ability to add a product to cart; intercepting proxy

The fix

The server should validate that the selected gift ID is among the gifts eligible for the user's cart before adding it.

How it was found

  1. Add a product to the cart and proceed to the free gift selection.
  2. Intercept the request sent when selecting a gift.
  3. Change the gift_id parameter to a different, unavailable gift's ID.
  4. Send the modified request and observe a successful response.
  5. Refresh the cart to see the ineligible gift added.

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 IDOR (Insecure Direct Object Reference) happens when a website uses a simple identifier, like a number, to refer to something and does not check if you are allowed to access it. Here, the gift selection request included a gift number, and the server accepted any number without verifying that the gift was actually available to that user. By changing the number, the attacker could add a gift that was not supposed to be free.

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.

More by scriptjacker

View all

12 more disclosed reports, 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.