Skip to content
DoS Disclosed report Beginner

[livechat.shopify.com] Cookie bomb at customer chats

The customer support application stored URL parameters in cookies without checking their length, and the escape function could triple the size of special characters. An attacker could craft a link that sets an oversized cookie for the .shopify.com domain, causing subsequent requests to the site to be rejected with a 400 error for 30 days.

s_p_q_r Follow

Originally disclosed on HackerOne

  • Triaged in 7 hours
  • Fixed in 6 days
  • Disclosed after 35 days

Summary by the program

Our customer support application would store a value from the query string in a cookie without checking the length of the value, which could cause subsequent requests to the app to be rejected if the total length of the cookie was too long.

The report

When we visit the https://livechat.shopify.com/customer/chats/new page the ref and ssid URL parameters are used to set cookie values the way as follows:

var getURLParameter = function(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/+/g, '%20'))||null; }

var brandedKeyword = function(ref) { var match1 = new RegExp("((google|yahoo|bing)(.)&?q=([^&])shopify)", "gi").test(ref); return (match1); }

var ref = getURLParameter('ref'); var ssid = getURLParameter('ssid');

if (ref && !brandedKeyword(document.referrer)) { var days = 30; var expire = new Date(today + days1000606024); setCookieWithExpiration('source', ref , expire); if (ssid) { setCookieWithExpiration('ssid', ssid , expire); } }

var setCookieWithExpiration = function(key, value, expire) { var match = document.location.hostname.match(/shopify..*/) var domain if(match){ domain = '.' + match[0] } else { domain = '.shopify.com' } document.cookie = key + "=" + escape(value) + ";path=/" +";expires=" + expire.toUTCString() + ';domain=' + domain; };

As we can see, the values lengths are not taken into consideration:

document.cookie = key + "=" + escape(value) + ";path=/" +";expires=" + expire.toUTCString() + ';domain=' + domain;

Furthermore, the escape function is used, which means a value consisting of special symbols will become three times longer. For example ,,, will turn into %2C. That means an attacker can create a valid link of proper length accepted both by the browser and the server, which however will make the cookie too long, so after his victim visits this link, https://livechat.shopify.com will stop working for him for 30 days (and the other shopify pages as well, cause these cookies are set for the .shopify.com domain).

PoC:

  1. Go to https://livechat.shopify.com/customer/chats/new?ref=,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  2. Go to https://livechat.shopify.com/customer/chats/new — result: 400 error
  3. Go to https://www.shopify.com/ — result: 400 error
  4. Go to https://app.shopify.com/services/partners/auth/login — result: 400 error

Tested with Firefox 42.0.

The original report as published on HackerOne, by s_p_q_r. 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

Impact

After a victim visits the crafted link, livechat.shopify.com and other Shopify pages could stop working for them for 30 days due to oversized cookies.

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Visit the customer chats new page with very long ref and ssid parameters.
  2. Visit the customer chats new page again and observe a 400 error.
  3. Visit the main Shopify website and observe a 400 error.
  4. Visit the Shopify partners login page and observe a 400 error.

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 cookie is a small piece of data a website stores in your browser. This site took a value from the web address and saved it as a cookie without limiting how long it could be. By making that value very long, an attacker could fill up the cookie jar so much that the site would refuse to load for the victim.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by s_p_q_r

View all

14 more disclosed reports, best first.

More from Shopify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.