many xss in widgets.shopifyapps.com
The style and button-bg-color parameters on widgets.shopifyapps.com were not properly sanitised, allowing an attacker to inject CSS expressions that execute JavaScript. An attacker could craft a link that, when opened in Internet Explorer 10 or earlier, runs arbitrary script in the victim's browser.
- Triaged in 22 hours
- Fixed in 44 days
- Paid in 47 days
- Disclosed after 50 days
xss does work only for internet explorer browser version <=10 (or in compatible mode)
xss in https://widgets.shopifyapps.com/products/...?style=[xss]&button-bg-color=[xss] is affected parameters style and button-bg-color (maybe to include expression in style of page)
example of xss for ie(i have test ie8 , windows os) :
https://widgets.shopifyapps.com/products/c-of-change?shop=rox-spa-md.myshopify.com&style=h%20.product-buy-button{x:expression(alert(1))}
how to reproduce:
- to use ie with version <=10
- go to the page (look at up)
- will be alert box with 1
Context
Shopify runs a product widget service at widgets.shopifyapps.com. The widget URL accepts query string parameters, two of which are style and button-bg-color. Two of those parameters, style and button-bg-color, control the appearance of the rendered button.
The report shows that both parameters were reflected into the page in a way that allowed script execution, but only in Internet Explorer 10 and below (or in compatibility mode). The researcher tested on IE8 on Windows.
Setup
No account, role or special tooling is needed. The only precondition is the browser:
- Use Internet Explorer with version 10 or lower, or run a newer IE in compatibility mode.
- Open one of the widget URLs below.
- An alert box with
1appears.
The researcher states that the XSS works only for Internet Explorer version <= 10, or in compatible mode. In other browsers the same payloads do not execute.
Finding it
The report states that the affected parameters are style and button-bg-color. The suspicion was that the value could be placed inside a CSS style context, which would allow an IE-specific expression() payload to run script. The report notes that the affected parameters are style and button-bg-color, and that the likely mechanism is the ability to include an expression in the style of the page.
Exploitation
Step 1: Confirm the reflected parameters
The widget URL takes the form:
https://widgets.shopifyapps.com/products/...?style=[xss]&button-bg-color=[xss]
The report notes that the affected parameters are style and button-bg-color, and that the likely mechanism is including an expression in the style of the page.
Step 2: Trigger the XSS with button-bg-color
Two working URLs use the button-bg-color parameter with an expression() payload:
https://widgets.shopifyapps.com/products/the-inbreds-winning-hearts?shop=zunior.myshopify.com&style=artgallery&image-size=compact&button-bg-color=expression(alert(1))
https://widgets.shopifyapps.com/products/buldre-bursdag-ekstra-personer?shop=klatrefabrikken.myshopify.com&style=artgallery&button-bg-color=expression(alert(1))
Both URLs carry style=artgallery and button-bg-color=expression(alert(1)); the first also has image-size=compact. The expression() function is an IE-only CSS feature that evaluates JavaScript; when the value is placed into a style declaration, IE evaluates alert(1).
Step 3: Trigger the XSS with style
A third working URL uses the style parameter itself to break out of the expected value and inject a CSS rule containing expression():
https://widgets.shopifyapps.com/products/c-of-change?shop=rox-spa-md.myshopify.com&style=h%20.product-buy-button{x:expression(alert(1))}
The style value is h .product-buy-button{x:expression(alert(1))} after URL decoding. The style value is h .product-buy-button{x:expression(alert(1))} after URL decoding, and this URL triggers the alert in IE.
Step 4: Observe the result
On IE8 on Windows, opening any of the three URLs produces an alert box containing 1. The report does not describe any other response, header or server-side behaviour.
Root cause
The style and button-bg-color parameters accept values that reach a CSS context, and IE evaluates the expression(). Because IE 10 and below support CSS expression(), a value that reaches a style declaration can execute JavaScript. Modern browsers do not support expression(), which is why the payload only fires in IE <= 10 or in compatibility mode. The report does not describe any server-side validation or output encoding.
Impact
The payload runs script in the page served from widgets.shopifyapps.com, demonstrated with alert(1) in IE8. The practical reach is limited by the browser condition: victims on modern browsers are not affected.
Fix
Variants to test
- A positive result is an alert box.
- A positive result is an injected rule that executes.
- A positive result is the same alert, confirming the compatibility-mode path.
Hunting notes
Impact here depends on the browser condition, and the researcher demonstrated it with a minimal alert(1) on IE8.
What happened, in plain words
Shopify runs a service at widgets.shopifyapps.com that takes settings in the URL. That service lives at widgets.shopifyapps.com. The widget URL takes settings in its query string, including style and button-bg-color.
The researcher found that the style and button-bg-color parameters were affected. In most browsers that is harmless, because the copied text just sits there as styling information. But old versions of Internet Explorer (version 10 and below) had a feature that let styling information run JavaScript. So by putting a small piece of JavaScript into one of those settings, the researcher could make the browser run it. The proof was a pop-up alert box showing 1.
This kind of bug is called cross-site scripting, or XSS. The name sounds complicated, but the idea is simple: a website takes something a visitor supplied (here, part of the URL) and treats it as if it were the website's own instructions.
A useful everyday comparison: imagine a restaurant where you write your order on a card and the kitchen sticks the card on the wall as decoration. Normally that is fine. But if you write "give this customer the keys to the safe" on the card and the kitchen staff read the wall as instructions, you have a problem. The card was data, but it got treated as an order.
The service and the settings involved
Before the steps, a few words about the pieces involved.
- A widget is a small, self-contained piece of a web page that a shop can drop into its own site. Here it is a buy button for one product.
- A URL is the address you type in a browser. Everything after a
?is called the query string, and it is a list of settings in the formname=value, separated by&. For example,?style=artgallerysets the setting calledstyleto the valueartgallery. - A parameter is one of those named settings in the query string.
styleandbutton-bg-colorare parameters. - Reflection means the server takes a value from the request and writes it back into the page it returns. If the value is written back unchanged, it is "reflected verbatim".
- CSS is the language that describes how a page looks: colours, sizes, positions. A style declaration is one instruction in CSS, such as a colour for a background.
- JavaScript is the language that makes pages do things, such as show a pop-up.
alert(1)is the simplest JavaScript instruction there is: it opens a pop-up box containing the number 1. Researchers use it as a harmless proof that code ran.
The report notes that the affected parameters are style and button-bg-color, and that the likely mechanism is including an expression in the style of the page.
Setting up
No account, no login and no special software are needed. The only precondition is the browser:
- Use Internet Explorer with version 10 or lower, or run a newer IE in compatibility mode.
- Open one of the widget URLs below.
- An alert box with
1appears.
The researcher states that the XSS works only for Internet Explorer version <= 10, or in compatible mode. In other browsers the same payloads do not execute. The researcher tested on IE8 on Windows.
Why the browser matters: expression() was a feature of old Internet Explorer that allowed a CSS value to contain a JavaScript expression, which the browser would evaluate. It was removed in later versions and never existed in other browsers. So a payload that relies on it is like a key cut for one specific old lock: it does nothing anywhere else.
Finding it
The researcher noted that the affected parameters are style and button-bg-color. If the value ends up inside a CSS style context, then an IE-specific expression() payload could run script. The report notes that the affected parameters are style and button-bg-color, and that the likely mechanism is the ability to include an expression in the style of the page.
This is the core of the hunt: find a value you control, find where it appears in the returned page, and ask what that position means to the browser. Text in a paragraph is just text. Text inside a style rule is an instruction to the browser's styling engine, and in old IE that engine could be persuaded to run JavaScript.
Exploitation
Step 1: Confirm the reflected parameters
The widget URL takes the form:
https://widgets.shopifyapps.com/products/...?style=[xss]&button-bg-color=[xss]
Reading this line by line:
https://widgets.shopifyapps.com/products/...is the address of the widget for some product. The...stands for the part that identifies which product.?starts the query string, the list of settings.style=[xss]is the setting that chooses the visual style. The[xss]is a placeholder showing where a malicious value would go.&separates one setting from the next.button-bg-color=[xss]is the setting for the button background colour, again with a placeholder for the malicious value.
In other words, the plan is not to inject a script tag, but to inject a styling instruction that old IE will execute as code.
Step 2: Trigger the XSS with button-bg-color
Two working URLs use the button-bg-color parameter with an expression() payload:
https://widgets.shopifyapps.com/products/the-inbreds-winning-hearts?shop=zunior.myshopify.com&style=artgallery&image-size=compact&button-bg-color=expression(alert(1))
https://widgets.shopifyapps.com/products/buldre-bursdag-ekstra-personer?shop=klatrefabrikken.myshopify.com&style=artgallery&button-bg-color=expression(alert(1))
Taking the first URL apart:
https://widgets.shopifyapps.com/products/the-inbreds-winning-heartsis the widget page for one particular product.shop=zunior.myshopify.comis a parameter in the URL.style=artgalleryis a parameter in the URL.image-size=compactis a parameter in the URL.button-bg-color=expression(alert(1))is the payload: instead of a colour, the value is an old-IE expression that runsalert(1).
The second URL uses the same button-bg-color=expression(alert(1)) payload.
Why this works: the expression() function is an IE-only CSS feature that evaluates JavaScript. When the value is placed into a style declaration, IE evaluates alert(1). The browser thinks it is computing a colour, but the computation is JavaScript, and the JavaScript pops up a box.
Step 3: Trigger the XSS with style
A third working URL uses the style parameter itself to break out of the expected value and inject a CSS rule containing expression():
https://widgets.shopifyapps.com/products/c-of-change?shop=rox-spa-md.myshopify.com&style=h%20.product-buy-button{x:expression(alert(1))}
Line by line:
https://widgets.shopifyapps.com/products/c-of-changeis the widget page for this product.shop=rox-spa-md.myshopify.comidentifies the shop.style=h%20.product-buy-button{x:expression(alert(1))}is the payload placed in thestylesetting.%20is how a space is written inside a URL, so after the browser decodes it the value ish .product-buy-button{x:expression(alert(1))}.
The style value is h .product-buy-button{x:expression(alert(1))} after URL decoding. The style value is h .product-buy-button{x:expression(alert(1))} after URL decoding, and this URL triggers the alert in IE.
Old IE reads that rule, evaluates the expression, and the alert appears.
Step 4: Observe the result
On IE8 on Windows, opening any of the three URLs produces an alert box containing 1. The report does not describe any other response, header or server-side behaviour.
That pop-up is the whole proof. It shows that code chosen by the person who wrote the URL ran inside the page served by widgets.shopifyapps.com. Nothing else was needed to demonstrate the bug.
Root cause
The style and button-bg-color parameters accept values that reach a CSS context, and IE evaluates the expression(). Because IE 10 and below support CSS expression(), a value that reaches a style declaration can execute JavaScript. Modern browsers do not support expression(), which is why the payload only fires in IE <= 10 or in compatibility mode. The report does not describe any server-side validation or output encoding.
A comparison: sanitisation is like a form that only accepts a date in a fixed format. If the form instead accepts anything you write and files it as an official instruction, then whatever you write becomes an instruction.
Impact
The payload runs script in the page served from widgets.shopifyapps.com, demonstrated with alert(1) in IE8. The practical reach is limited by the browser condition: victims on modern browsers are not affected.
"Origin" here means the combination of scheme, host and port that a browser uses to decide which pages may touch each other's data. Script running in the widgets.shopifyapps.com origin is treated by the browser as belonging to that site, not to the attacker's site. That is why XSS matters: the browser trusts the code because of where it appears to come from. The report stops at the alert and does not explore what an attacker could do with that trust.
Fix
An allowlist is the opposite of a blocklist: instead of trying to guess and forbid bad input, you accept only the small set of values you expect, such as a fixed list of style names and colour codes. Anything else is rejected. Encoding means rewriting special characters so the browser treats them as plain text rather than as part of the page's structure.
Variants to test
- A positive result is an alert box.
- A positive result is an injected rule that executes.
- A positive result is the same alert, confirming the compatibility-mode path.
Hunting notes
Impact here depends on the browser condition, and the researcher demonstrated it with a minimal alert(1) on IE8.
Glossary
- Alert box: a small pop-up a browser shows when JavaScript calls
alert(). Researchers use it as harmless proof that code ran. - Allowlist: a list of values that are explicitly permitted; everything else is rejected.
- API: a defined way for one piece of software to ask another for something, like a service counter with a fixed set of requests it accepts.
- Compatibility mode: a setting in Internet Explorer that makes it behave like an older version of itself.
- Cross-site scripting (XSS): a bug where a site takes input from a visitor and lets it run as code in the browser, so the browser obeys the attacker instead of the site.
- CSS: the language that describes how a web page looks, such as colours, sizes and layout.
- Declaration block: the part of a CSS rule inside curly braces that contains the actual style instructions.
- Encoding: rewriting special characters so they are treated as plain text rather than as part of the page's structure.
expression(): an old Internet Explorer CSS feature that evaluates a JavaScript expression inside a style value. Removed in later versions and never present in other browsers.- JavaScript: the programming language that makes web pages interactive and can run code in the browser.
- Origin: the combination of scheme, host and port that a browser uses to decide which pages may access each other's data.
- Parameter: a named setting in a URL's query string, written as
name=value. - Payload: the piece of input an attacker supplies to trigger a bug.
- Query string: the part of a URL after the
?, holding settings separated by&. - Recon: the information-gathering phase before testing, such as loading pages and inspecting their source.
- Reflection: when a server copies a value from the request back into the page it returns.
- Sanitisation: cleaning input so that dangerous characters or structures cannot take effect.
- Selector: the part of a CSS rule that says which elements the rule applies to, such as
.product-buy-button. - Style attribute: an HTML attribute on an element that holds CSS instructions for that element.
- Stylesheet: a collection of CSS rules that a page uses.
- URL: the address of a resource on the web, such as a page or an image.
- Widget: a small, self-contained piece of a web page that can be embedded in another site, here a buy button.