Unlimited Shopping: Exploiting a Cart Logic Flaw to Bypass Produc
The cart API validated each line item's quantity against the purchase limit but did not check the total quantity per product across duplicate lines. An attacker could add the same product multiple times in one request to exceed the allowed purchase limit.
While testing an e-commerce API during a security assessment, I discovered a business logic vulnerability that allowed bypassing purchase limits for restricted products.
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 backend validated each line item independently instead of checking the total quantity per product SKU across all lines.
Impact
An attacker could bypass purchase limits and buy unlimited quantities of restricted products, potentially harming promotional inventory and fairness.
What the attacker needed
A user account; ability to intercept and modify API requests
The fix
The backend should validate the total quantity per SKU against the limit and reject requests with duplicate product lines.
How it was found
- Add a restricted product to the cart.
- Intercept the cart update request containing a JSON lines array.
- Duplicate the same product entry multiple times in the lines array.
- Send the modified request; the server sums the quantities and accepts the 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.
An online shop limits how many of a discounted item you can buy. The server checked each line in your cart separately, so if you put the same item on several lines, each line looked fine but the total was over the limit. This let someone buy more than allowed.
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.