Skip to content
Business logic Write-up Beginner

Steps to reproduce

The e-commerce site allowed a negative product quantity in the cart, which reduced the total price. An attacker could add a negative quantity of one item and positive quantities of others to bring the cart total below the minimum, then pay a lower price.

Divyanshu Shukla Follow

Published on blog.usejournal.com

I received a hacking invite from a very popular e-commerce website. I have been ordering from that website for a very long time.

Divyanshu, on blog.usejournal.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 application did not validate the lower bound of the quantity parameter, allowing negative values that reduced the cart total.

Impact

The attacker could buy products at a lower price by manipulating the cart total, as the negative quantity reduced the overall cost.

What the attacker needed

A user account on the site; ability to intercept HTTP requests

The fix

The application should validate that the quantity is within a positive range (e.g., 1–10) on the server side and not rely on client-side controls.

How it was found

  1. Add a product to the cart and intercept the request.
  2. Change the quantity to a negative number.
  3. Add other products with positive quantities to balance the cart total.
  4. Ensure the total is above the minimum cart value.
  5. Proceed to checkout and pay the reduced amount.

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.

When you shop online, the website often lets you change how many items you want. This site did not check that the number was positive. By sending a negative number, the attacker made the cart total go down, so they paid less than they should.

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.

More by Divyanshu Shukla

View all

1 more disclosed report, best first.

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.