Cookie securing your "Opening soon" store is not secured against XSS
The storefront password-protection cookie set by the platform is not marked HttpOnly, so it can be read by client-side scripts. An attacker who can run script in the store's context could steal the cookie and use it to reach a password-protected 'Opening soon' store without knowing the password.
- Triaged in 31 hours
- Fixed in 9 days
- Disclosed after 9 days
PoC:
- Protect your e-shop with a password (Storefront password)
- Go to your e-shop URL and enter the password to access the store
- There is a cookie created - name: storefront_digest - this cookie contains the password (in a secure way) which protects your store
- This cookie is not marked as HttpOnly, so if there is e.g. XSS, anyone can steal this cookie
- With this cookie anyone can access your "Opening soon" e-shop, even if he doesn't know the password
Before you answered I would like to confirm that I read shopify terms and:
- I don't care about he password strength. It is not important in that case
- I am pretty sure that this cookie - storefront_digest - is a sensitive cookie since by stealing this cookie you can access resources you shouldn't be able to...
Thank you.
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 storefront password cookie was issued without the HttpOnly attribute, leaving it readable by JavaScript.
Impact
If an XSS flaw exists on the store, an attacker could steal the cookie and use it to view the password-protected store without knowing the password; the report does not show an actual XSS.
What the attacker needed
Storefront password protection enabled; an XSS flaw on the store; attacker obtains the stolen cookie
How it was found
- Enable the storefront password protection on the shop.
- Open the shop URL and enter the password to get in.
- Observe the storefront_digest cookie that is created.
- Note that the cookie lacks the HttpOnly flag and can be read by scripts.
- Reuse the stolen cookie to access the protected store without the password.
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 a shop is still being built, the owner can lock it behind a single shared password. After you type that password, the site gives your browser a small piece of data called a cookie so it remembers you are allowed in. A flag called HttpOnly tells the browser to hide that cookie from page scripts; without it, any malicious script running on the page could read the cookie and send it elsewhere, letting someone else get into the locked shop.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.