Skip to content
IDOR Write-up Beginner

How I Found a Broken Object Level Authorization (BOLA) in a Real Production App

The cart API trusted a client-supplied cart identifier in a cookie and never checked that the cart belonged to the logged-in user. An attacker with their own account could add or remove items in another user's cart by swapping in that user's cart identifier.

77r4sed Follow

Published on medium.com

This is the write-up of how I found a Broken Object Level Authorization (BOLA) vulnerability that allowed cross-account cart manipulation using a client-controlled cart identifier.

Null, 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.

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

The backend used a client-controlled cart identifier from a cookie to select the cart and did not verify that the cart belonged to the authenticated user.

Impact

An attacker could add or remove items in another user's cart, inflate totals and disrupt checkout, with no victim interaction.

What the attacker needed

An account on the platform; knowledge of another user's cart identifier

The fix

The server should bind each cart to the authenticated user and reject any request whose cart identifier does not belong to that user.

How it was found

  1. Notice the cart identifier is stored client-side in a cookie.
  2. Set up two accounts, each with its own session and cart, and put an item in the second account's cart.
  3. Intercept the remove-item request from the first account and replace its cart cookie with the second account's cart identifier.
  4. Send the request and observe a 200 response with the item removed from the second account's cart.
  5. Repeat the same cookie swap on the add-to-cart endpoint and observe a 200 response with the item added to the second account's cart.

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 cart is meant to belong to one person, but the server decided which cart to change by reading an identifier the browser sent in a cookie. Because it never checked that this cart belonged to the logged-in account, anyone who knew another person's cart identifier could change that person's cart. This kind of flaw is called broken object level authorization, or BOLA: the server fails to check that you own the object you are acting on.

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.

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.