Skip to content
Business logic Write-up Beginner

I Entered 100 In An E Commerce Cart The Server Accepted It

The shopping cart accepted a negative product quantity and propagated it into the cart calculation. An attacker could potentially cause incorrect order totals, inventory inconsistencies, or discount abuse, depending on how the value is processed downstream.

Fenil sheta Follow

Published on cybersecuritywriteups.com

I started by testing authentication and authorization. Nothing interesting came up.

Fenil sheta, on cybersecuritywriteups.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 backend validated that the quantity was an integer but did not enforce that it must be at least one, so it treated a negative quantity as a valid business operation.

Impact

Depending on how the application processes the affected values, this could potentially result in incorrect order totals, inventory inconsistencies, invalid transaction records, discount or refund abuse, or financial discrepancies.

What the attacker needed

Access to the shopping cart; ability to modify quantity parameter

The fix

The backend should independently validate that the quantity is at least one and reject invalid requests, rather than relying on the frontend.

How it was found

  1. Test authentication, authorization, session handling, and access control without finding issues.
  2. Move to testing the shopping workflow: registration, add to cart, quantity, discounts, checkout.
  3. Change a product quantity to a negative value.
  4. Observe that the application accepts the negative quantity and continues processing it.

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 should only let you buy one or more of an item. Here, the shop's computer program accepted a request to buy a negative number of items, which could make the total price wrong or mess up stock records. This is a business logic flaw: the input is a valid number, but it is not a valid purchase.

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.