Skip to content
Business logic Write-up Beginner

Quantity Manipulation Allows Purchases at Reduced Prices

The online store accepted fractional quantities such as 0.5 or 0.01 when updating a cart item, and the price was recalculated proportionally, so an attacker could buy a $3000 product for $30 plus shipping. The order was processed at the reduced total, though the test card was declined for insufficient funds.

medium.com

Published on medium.com

During a penetration testing engagement at CyberAR, I discovered a critical vulnerability that allows attackers to purchase products at significantly reduced prices through quantity manipulation.

Abdelrahman0x01, 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 trusted a client-supplied quantity without validating that it is a positive whole number, and calculated the price by simple multiplication.

Impact

An attacker could place orders at a fraction of the intended price, causing direct revenue loss; the test order was ultimately declined only because the card had insufficient funds.

What the attacker needed

A customer account on the store; ability to intercept and edit HTTP requests; a payment card

How it was found

  1. Add a product to the cart and intercept the add-to-cart request to find the quantity parameter.
  2. Change the quantity to a fractional value such as 0.5 and add the item to the cart.
  3. Intercept the cart update request, raise the quantity to 2, then change it to 0.5 and observe the price drop.
  4. Repeat with an even smaller quantity such as 0.01 to reduce the price further.
  5. Proceed to checkout and confirm the total shown is the reduced amount.
  6. Place the order with a card that cannot cover the full price and see the reduced total accepted.

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 online shop normally expects you to buy whole numbers of an item, like 1, 2 or 3. Here the shop also accepted fractions such as 0.5 or 0.01 and multiplied the price by that fraction, so a very small quantity made the price tiny. The shop should have rejected anything that is not a whole number before working out the 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.