Business Logic Vulnerability Leading to Negative Cart Values and
An e-commerce shopping cart accepted a negative product quantity, which made the cart total negative. An attacker could then add other products so the final payable amount dropped to almost nothing and still complete the order.
While testing an e-commerce platform, I discovered an interesting Business Logic vulnerability in the shopping cart functionality that allowed price manipulation through negative quantity values.
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 application did not validate product quantities on the server side, so negative values were accepted into the cart total calculation.
Impact
An attacker could reduce the payable amount dramatically and still complete the order, paying a tiny fraction of the real price.
What the attacker needed
A shopper account on the store; ability to edit cart quantity
The fix
The cart should reject negative and zero quantities on the server, validate cart operations before checkout, and recalculate totals securely on the backend.
How it was found
- Add an expensive product to the cart.
- Change that product's quantity to a negative value.
- Add many cheaper products with positive quantities.
- Complete the purchase at a much lower total.
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 shopping cart should only accept sensible amounts, like one or more of an item. Here the server trusted whatever number the shopper sent, including a minus one, so the total could go below zero. Adding normal items then cancelled out the price, letting the buyer pay far less than the real cost.
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.