CSRF: How I gained unauthorized access to Cart
The shopping website's cart actions lacked CSRF protection, allowing an attacker to add or delete items in a victim's cart via a crafted request. The author demonstrated this by creating a CSRF PoC and testing it on a second account.
medium.com
Published on medium.com
Today, I will share with you how I gained unauthorized access to a cart on a shopping website
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 application did not implement any anti-CSRF tokens or other protections for cart modification requests.
Impact
An attacker could add or delete items in a victim's cart without their consent, potentially leading to unwanted purchases or cart manipulation.
What the attacker needed
Victim logged in; victim visits attacker's page
How it was found
- Browse the shopping site with Burp Suite running.
- Add a product to the cart and observe the request.
- Generate a CSRF PoC using Burp Suite's engagement tools.
- Test the PoC on a second account to confirm it works.
- Try other HTTP methods like DELETE to remove items from the cart.
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.
CSRF (Cross-Site Request Forgery) is when a malicious website tricks your browser into sending a request to another site where you're logged in, without your knowledge. Here, the shopping site didn't check that requests to add or remove cart items actually came from its own pages, so an attacker could make your browser perform those actions.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.