Stored - XSS
A stored cross-site scripting flaw existed in the supplier messaging feature, where a message body was saved and later rendered without proper encoding. An attacker could inject script that executes in the inbox of anyone who views the message, potentially stealing session data or acting as the victim.
Originally disclosed on HackerOne
- Triaged in 5 hours
- Fixed in 15 days
- Disclosed after 49 days
Hello Security Team, I have Found Stored XSS Vulnerability
POC : Step1: Go to https://app.oberlo.com/suppliers Step2: Click on any product you will be redirected to URL as i have given for example https://app.oberlo.com/suppliers/8/products/488813?referralUrl=https%3A%2F%2Fapp.oberlo.com%2Fsuppliers%2F8%2Fproducts Step3: You will get message icon in front of supplier name Step4: Click on that message Step5: Add Reason-->Subject-->and in message add my payload Payload: "><img src=x onerror=prompt(document.cookie)> Step6: Click on send message Step7: Go to Inbox and you will see XSS is triggered and your payload was executed successfully
I have attached POC Video, Please go through it
Thank you! Ashish Dhone
Impact
An attacker who exploits a cross-site scripting vulnerability is typically able to:
- Impersonate or masquerade as the victim user.
- Carry out any action that the user is able to perform.
- Read any data that the user is able to access.
- Capture the user's login credentials.
- Perform virtual defacement of the web site.
- Inject trojan functionality into the web site.
Attachments
Context
Oberlo is a Shopify product-sourcing application, reachable at app.oberlo.com. The feature involved here is the supplier messaging system: a supplier is listed under /suppliers, each supplier has products, and next to the supplier name there is a message icon that opens a form for contacting the supplier. The form takes a reason, a subject and a message body, and the message is delivered to an inbox inside the application.
The report describes a stored cross-site scripting issue in that message flow. The payload is saved as part of a message and executes when the researcher opens the inbox.
Setup
No special tooling, role or configuration is described. The researcher works against https://app.oberlo.com, opens the supplier and product pages, and uses the message form.
Finding it
The researcher does not describe the reasoning that led to the message form. What the report shows is the result: the message body is rendered as HTML when the message is read in the inbox, so an image tag with an onerror handler placed in the body executes.
Exploitation
Step 1: Open the suppliers page
https://app.oberlo.com/suppliers
This is the entry point to the supplier list for the logged-in account.
Step 2: Open a product
Clicking any product redirects to a URL of this shape, given in the report as an example:
https://app.oberlo.com/suppliers/8/products/488813?referralUrl=https%3A%2F%2Fapp.oberlo.com%2Fsuppliers%2F8%2Fproducts
The path carries a supplier identifier (8) and a product identifier (488813), and the referralUrl query parameter carries the URL-encoded address of the supplier's product list. The report does not say whether referralUrl plays any part in the vulnerability; it is simply the URL the researcher landed on.
Step 3: Locate the message icon
On the product page there is a message icon in front of the supplier name. This is the control that opens the messaging form.
Step 4: Open the message form
Clicking the icon opens the form used to send a message to the supplier.
Step 5: Fill the form with the payload
The form has three fields: Reason, Subject and the message body. The payload goes into the message body:
"><img src=x onerror=prompt(document.cookie)>
The payload begins with "> and then an <img> tag with an onerror handler. The src=x points at a resource that does not exist, so the image fails to load, and the onerror handler fires. The handler calls prompt(document.cookie), which shows a dialog containing the page's cookies.
Step 6: Send the message
Submitting the form stores the message with the payload in it.
Step 7: Open the inbox
Navigating to the inbox renders the stored message, the payload executes, and the dialog appears. The report states that the XSS is triggered and the payload executes successfully at this point.
The researcher says a proof-of-concept video was attached.
Root cause
The report does not analyse the server-side or client-side code, so the exact mistake is not shown. What the behaviour implies is that the message body is stored and later inserted into the inbox page as HTML without adequate encoding or sanitisation, so markup supplied by the sender is parsed by the browser. The "> prefix in the payload suggests the value is placed inside an HTML attribute in the rendered output, and that the surrounding quoting can be broken out of. Why the application's existing output handling did not neutralise the tag is not described in the report.
Impact
The report lists the standard consequences of a cross-site scripting vulnerability. An attacker who exploits it is typically able to:
- Impersonate or masquerade as the victim user.
- Carry out any action that the user is able to perform.
- Read any data that the user is able to access.
- Capture the user's login credentials.
- Perform virtual defacement of the web site.
- Inject trojan functionality into the web site.
The concrete reach of this instance depends on who opens the message. The payload executes in the inbox of the account that opens the stored message, in the origin of app.oberlo.com.
Fix
Variants to test
- Try the same payload in the Subject and Reason fields, not only the body. A positive result is the dialog appearing when the message is opened from the inbox.
- Try payloads that do not depend on breaking out of an attribute, for example a bare
<img src=x onerror=...>or an<svg onload=...>element, to see whether the body is inserted as element content in some views. A positive result is execution without the">prefix. - Try the payload in any other place the message is displayed, such as a sent-items view, a notification preview or an email copy of the message. A positive result is execution in any of those contexts.
- A positive result is the value being reflected into the page unencoded.
Hunting notes
Messaging and inbox features are a common home for stored XSS because the same text is written by one user and rendered for another, often through several views. During recon, look for forms that accept free text and for any place that text is later displayed, including notification badges and previews. The signal in this report is simple: a message body that is echoed back into the inbox page as markup. The researcher demonstrated execution with prompt(document.cookie) and described the steps from the supplier page through to the inbox.
What happened, in plain words
Oberlo is a Shopify application that helps shop owners find products to sell. It lives at app.oberlo.com. One of its features is a messaging system: a supplier is listed under /suppliers, each supplier has products, and next to the supplier name there is a message icon that opens a form for contacting that supplier. The form has three fields: a reason, a subject and a message body. The message is delivered to an inbox inside the application.
The researcher found that the payload in the message body executes when the inbox is opened. Instead, the application puts whatever was typed into the page as if it were part of the page's own code. That means a sender can type something that is not a sentence but a small piece of HTML, the language web pages are written in, and the browser will obey it. When the message is opened in the inbox, that piece of HTML runs as code in the browser. This is called stored cross-site scripting, or stored XSS: "stored" because the malicious text is saved on the server first and runs later, and "cross-site scripting" because code from one place ends up running inside another site's page.
A simple comparison: imagine a noticeboard where visitors pin notes, and the person who runs the board copies each note word for word onto an official letter. If a visitor writes "please ignore the rest of this letter", the copyist does not question it, and the official letter now says something the office never intended. Here the message body is the note and the inbox page is the official letter.
Context
The feature involved is the supplier messaging system. A supplier is listed under /suppliers, each supplier has products, and next to the supplier name there is a message icon that opens a form for contacting the supplier. The form takes a reason, a subject and a message body, and the message is delivered to an inbox inside the application.
The report describes a stored cross-site scripting issue in that message flow. The payload is saved as part of a message and is executed when the message is later viewed in the inbox.
Setup
No special tooling, role or configuration is described. The researcher works against https://app.oberlo.com, opens the supplier and product pages, and uses the message form.
Finding it
The researcher does not describe the reasoning that led to the message form. What the report shows is the result: the message body is rendered as HTML when the message is read in the inbox, so an image tag with an onerror handler placed in the body executes.
Two ideas are worth unpacking here. An HTML tag is a piece of markup in angle brackets, such as <img>, which tells the browser to show an image. An attribute is a setting written inside the tag, such as src, which says where the image comes from. An event handler is an attribute whose value is code the browser runs when something happens, such as onerror, which fires when the image fails to load. If a page lets a visitor's text become a real tag with a real event handler, the visitor's text becomes code.
Exploitation
Step 1: Open the suppliers page
https://app.oberlo.com/suppliers
This is the entry point to the supplier list for the logged-in account.
Step 2: Open a product
Clicking any product redirects to a URL of this shape, given in the report as an example:
https://app.oberlo.com/suppliers/8/products/488813?referralUrl=https%3A%2F%2Fapp.oberlo.com%2Fsuppliers%2F8%2Fproducts
The path carries a supplier identifier (8) and a product identifier (488813), and the referralUrl query parameter carries the URL-encoded address of the supplier's product list. The report does not say whether referralUrl plays any part in the vulnerability; it is simply the URL the researcher landed on.
Reading the URL piece by piece: the part before the ? is the path, which points at one supplier and one product. The part after the ? is the query string, a set of named values the page can read. referralUrl is the name, and its value is an address where the slashes and colons have been replaced by codes such as %3A and %2F. That replacement is called URL encoding, and it exists so that characters with special meaning in a URL can be carried as ordinary data.
Step 3: Locate the message icon
On the product page there is a message icon in front of the supplier name. This is the control that opens the messaging form.
Step 4: Open the message form
Clicking the icon opens the form used to send a message to the supplier.
Step 5: Fill the form with the payload
The form has three fields: Reason, Subject and the message body. The payload goes into the message body:
"><img src=x onerror=prompt(document.cookie)>
Line by line, in plain words:
">closes an attribute value and the tag it belongs to. The payload begins with">, then an<img>tag with anonerrorhandler.<imgstarts an image tag.src=xpoints the image at a resource that does not exist, so the image fails to load.onerror=prompt(document.cookie)is the event handler that runs when the image fails. It callsprompt, a browser function that shows a small dialog box, and passes itdocument.cookie, which is the set of cookies the page can see.>closes the image tag.
A cookie is a small piece of data a website asks the browser to keep and send back with later requests, commonly used to remember who is logged in. Showing it in a dialog is a simple proof that script is running in the application's origin, meaning in the context of app.oberlo.com with that user's session.
Step 6: Send the message
Submitting the form stores the message with the payload in it. This is the "stored" part: the text is saved and runs later.
Step 7: Open the inbox
Navigating to the inbox renders the stored message, the payload executes, and the dialog appears. The report states that the XSS is triggered and the payload executes successfully at this point.
The researcher says a proof-of-concept video was attached.
Root cause
The report does not analyse the server-side or client-side code, so the exact mistake is not shown. What the behaviour implies is that the message body is stored and later inserted into the inbox page as HTML without adequate encoding or sanitisation, so markup supplied by the sender is parsed by the browser. The "> prefix in the payload suggests the value is placed inside an HTML attribute in the rendered output, and that the surrounding quoting can be broken out of. Why the application's existing output handling did not neutralise the tag is not described in the report.
Encoding, in this context, means turning characters that have a special meaning in HTML into harmless stand-ins, so that < is displayed as a less-than sign rather than starting a tag. Sanitisation means inspecting the text and removing anything dangerous, such as event handler attributes. Either approach, applied when the message is displayed, would stop the payload.
Impact
The report lists the standard consequences of a cross-site scripting vulnerability. An attacker who exploits it is typically able to:
- Impersonate or masquerade as the victim user.
- Carry out any action that the user is able to perform.
- Read any data that the user is able to access.
- Capture the user's login credentials.
- Perform virtual defacement of the web site.
- Inject trojan functionality into the web site.
In everyday terms: because the code runs inside the victim's logged-in session, it can act as the victim, read what the victim can read, and change what the victim sees. Virtual defacement means altering the appearance of the page without touching the server. Trojan functionality means adding hidden behaviour that looks legitimate.
The concrete reach of this instance depends on who opens the message. The payload executes in the inbox of the account that opens the stored message, in the origin of app.oberlo.com.
Fix
Context-aware means the encoding matches the place the value lands: text between tags, a value inside an attribute and a value inside a script block each need different treatment. An allow-list is the opposite of a block-list: instead of naming what is forbidden, it names the small set of things that are permitted and rejects everything else.
Variants to test
- Try the same payload in the Subject and Reason fields, not only the body. A positive result is the dialog appearing when the message is opened from the inbox.
- Try payloads that do not depend on breaking out of an attribute, for example a bare
<img src=x onerror=...>or an<svg onload=...>element, to see whether the body is inserted as element content in some views. A positive result is execution without the">prefix. - Try the payload in any other place the message is displayed, such as a sent-items view, a notification preview or an email copy of the message. A positive result is execution in any of those contexts.
- A positive result is the value being reflected into the page unencoded.
These variants matter because a fix applied to one field or one view may not cover the others. Each test asks the same question in a different place: does my text become code here?
Hunting notes
Messaging and inbox features are a common home for stored XSS because the same text is written by one user and rendered for another, often through several views. During recon, look for forms that accept free text and for any place that text is later displayed, including notification badges and previews. The signal in this report is simple: a message body that is echoed back into the inbox page as markup. The researcher demonstrated execution with prompt(document.cookie) and described the steps from the supplier page through to the inbox.
Recon here means the early exploration of an application to map its features and find places worth testing. The lesson is to follow free text from where it is typed to every place it is shown.
Glossary
- API: a way for one piece of software to talk to another, usually by sending requests to addresses and getting structured answers back.
- Attribute: a setting written inside an HTML tag, such as
srcon an image tag. - Cookie: a small piece of data a website asks the browser to keep and send back with later requests, often used to remember a logged-in session.
- Cross-site scripting (XSS): a flaw where text supplied by a user is treated as code by the browser and runs inside the site's page.
- Stored XSS: XSS where the malicious text is saved on the server and runs later, when someone views it.
- Payload: the piece of text or code an attacker supplies to trigger a flaw.
- HTML: the language web pages are written in, made of tags in angle brackets.
- Tag: a piece of HTML markup such as
<img>that tells the browser what to display. - Event handler: an attribute whose value is code the browser runs when something happens, such as
onerrorwhen an image fails to load. - Origin: the combination of scheme, host and port that a page belongs to, such as
https://app.oberlo.com; code running in one origin can act with that site's session. - Session: the state that keeps a user logged in across requests, usually carried by a cookie.
- Encoding (HTML encoding): turning characters with special meaning in HTML into harmless stand-ins so they display as text.
- Sanitisation: inspecting user text and removing anything dangerous before displaying it.
- Allow-list: a list of what is permitted, with everything else rejected.
- Context-aware encoding: encoding that matches where a value is placed, such as inside an attribute versus between tags.
- URL encoding: replacing characters with special meaning in a URL with codes such as
%3Aand%2Fso they can be carried as data. - Query string: the part of a URL after the
?, made of named values the page can read. - Parameter: one named value in a query string, such as
referralUrl. - Inbox: the view inside the application where received messages are read.
- Proof of concept (POC): a demonstration that a flaw is real, here a recorded sequence of steps ending in the dialog appearing.
- Virtual defacement: changing what a page looks like without altering the server.
- Trojan functionality: hidden behaviour added to a site that appears legitimate.
- Recon: early exploration of an application to map its features and find places worth testing.