Day 20 - The app trusted me with whatever I added to its cart!
The shopping cart accepted a client-supplied product identifier without checking it against what the user was actually shown, so a tester could swap the product number in the request and add a different product to the cart. The text claims this could let an attacker add restricted or hidden products and manipulate purchase logic, though it does not demonstrate any of that.
medium.com
Published on medium.com
Target Application: https://github.com/Yavuzlar/VulnLab/tree/main
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 server used the product identifier from the request without checking it against the product the user was actually shown or allowed to buy.
Impact
An attacker could add products that were not shown or were restricted, and could potentially manipulate pricing or purchase logic, though the text only demonstrates that a different product appeared in the cart.
What the attacker needed
Access to the shopping cart feature; ability to intercept and edit requests
The fix
The server should validate product identifiers on its side and confirm that each product is authorised and available before adding it to the cart.
How it was found
- Intercept the request sent when a product is added to the cart.
- Note the product identifier parameter in the request.
- Change the identifier to a different product's number.
- Send the modified request and observe the cart contents.
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.
When you click 'Add to Cart', your browser sends a request to the server containing a number that identifies the product. This report says the server simply believed that number and added whatever product it pointed to, even if the page had shown something else. A person who edits the request can therefore choose a different product than the one displayed.
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.