How I Exploited a Low-Level Logic Flaw to Manipulate Product Pric
The application's purchasing workflow fails to properly validate the quantity and price calculation, allowing an attacker to manipulate the total price by sending repeated requests that cause an integer overflow. This enables purchasing a high-value product for a much lower price than intended.
Published on osintteam.blog
This lab explores a low-level logic flaw within a vulnerable e-commerce application hosted in the PortSwigger Web Security Academy environment. The flaw exists in the application’s purchasing workflow, where the backend logic does not adequately validate key conditions related to product pricing.
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 uses a fixed-size integer to store the total price and does not check for overflow when adding item costs, so a large total wraps to a negative number.
Impact
An attacker could purchase high-value products for a much lower price than intended, causing direct financial loss to the organisation.
What the attacker needed
A free account; ability to intercept and modify requests
The fix
The application should validate the quantity and price calculation to prevent integer overflow, for example by using a larger integer type or checking bounds before addition.
How it was found
- Log in to the lab with the provided credentials.
- Add the target product to the shopping cart.
- Intercept the request and change the quantity parameter to 99.
- Configure Burp Intruder with a null payload and set maximum concurrent requests to 1.
- Start the attack and monitor the total price in the cart until it wraps around to a negative value.
- Pause the attack, add a second product, and adjust its quantity so the total falls within the account balance, then place the order.
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 adds up the cost of items in your cart. If you add a huge number of items, the total can become so large that the computer's number storage overflows and wraps around to a negative value. The shop then thinks you owe a negative amount, so you can add other items and pay very little.
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.