Skip to content
Business logic Write-up Beginner

I Made a Store Pay Me to Buy a $1337 Jacket — On Holi.

The application accepted negative quantities when adding items to the cart, allowing an attacker to subtract the cost of a cheap item from the total. By adding a negative quantity of a cheap item, the attacker could reduce the price of an expensive jacket to within their store credit and complete the purchase.

medium.com

Published on medium.com

At first glance, everything looks chaotic. But if you look closely, there’s pattern, intention, and structure behind it.

TEJAS, 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

Likely the server did not validate that the quantity parameter was a positive integer and simply calculated price times quantity, allowing negative values to reduce the total.

Impact

An attacker could buy products at a fraction of their price, causing financial loss to the store.

What the attacker needed

A user account; ability to intercept HTTP requests

The fix

The application should validate that quantity is a positive integer and enforce business rules on cart totals.

How it was found

  1. Log in and add the expensive jacket to the cart.
  2. Intercept the request to add a cheap item to the cart.
  3. Change the quantity parameter to a negative number.
  4. Forward the request; the cart total decreases.
  5. Adjust the negative quantity so the final total is within the store credit.
  6. Proceed to checkout and complete the order.

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.

This is a business logic flaw: the website trusted a number the user could change (the quantity) without checking it made sense. By sending a negative quantity, the attacker made the cart subtract money instead of adding it, so they could buy an expensive item for less than its price.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.