Skip to content
Business logic Write-up Beginner

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.

0xKemzx Follow

Published on medium.com

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.

0xKemzx, 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 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

  1. Add an expensive product to the cart.
  2. Change that product's quantity to a negative value.
  3. Add many cheaper products with positive quantities.
  4. 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.

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.