Smuggling Orders Past Business Logic
The GraphQL API accepted cart item quantities beyond the UI limit and allowed checkout below the minimum order value. An attacker could bypass business rules to order more items than allowed and check out with a cart total under the required minimum.
medium.com
Published on medium.com
The modern web is a complex beast. We build intricate user interfaces designed to guide users, validate their inputs, and ensure they follow the rules.
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 GraphQL resolver trusted the client-supplied quantity value without validating it against the product's actual constraints.
Impact
An attacker could bypass quantity limits and minimum order value rules, potentially ordering more items than allowed and checking out below the required minimum.
What the attacker needed
A user account on the platform; ability to intercept HTTP requests
How it was found
- Add 10 avocados to the cart, reaching a total just below the minimum order value.
- Intercept the GraphQL request for updating cart items.
- Modify the quantity field to 15 and send the request.
- Observe the server accepts the update and the cart shows 15 items.
- Modify the quantity to 5, dropping the total below the minimum, and send the request.
- Observe the checkout button becomes active despite the 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.
The website's shopping cart had rules like 'no more than 10 avocados' and 'spend at least $10 to check out'. These rules were only enforced in the browser, so by changing the request sent to the server, the rules could be ignored. The server should have checked the rules itself.
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.