Skip to content
XSS Disclosed report Beginner

Stored XSS at https://app.smtp2go.com/settings/users/

The application did not filter the username field when creating an SMTP user, allowing a stored cross-site scripting payload. When that user was selected in the webhooks feature, the script executed, potentially letting an attacker perform privileged operations or steal cookies.

testerpro Follow

Originally disclosed on HackerOne

  • Fixed in 13 hours
  • Disclosed after 16 hours

Vulnerability : A. Type:- Cross Site Scripting (Stored) B. Description:- Stored XSS, also known as persistent XSS, is the more damaging than non-persistent XSS. It occurs when a malicious script is injected directly into a vulnerable web application. Summary : When you will create a particular user you will have to enter username and you can enter Xss payload than on webhooks it will fire that XSS. As the website is not filtering the input provided by the user, that's why this problem is there. Thank You.

Steps To Reproduce:

[add details for how we can reproduce the issue]

  1. Create an account https://app.smtp2go.com and LOG IN using username and password.
  2. After that you will be redirected to dashboard and click on settings and then click on SMTP users.
  3. Click on Add SMTP USER and enter �</form><input type="date" onfocus="alert(1)"> this payload on username and save it.
  4. After that down below click on webhooks and then continue and then ADD WEBHOOK and then from users select that user which we had created earlier and it will fire the pop up.

I had attached the PoC you can see it.

Supporting Material/References:

  • [attachment / reference]

Impact

If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user such as steal Cookies of user,etc.

Attachments

bandicam_2020-07-01_14-55-16-300.mp4 From the original on HackerOne

The original report as published on HackerOne, by testerpro. 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. 4 min read.

Context

SMTP2GO is an email delivery service, and the target here is its customer-facing application at app.smtp2go.com. The report concerns the settings area, specifically the SMTP users feature and the webhooks feature that sits alongside it.

SMTP users are the credentials an account holder creates so that applications can authenticate and send mail through the service. Each user has a username, and that username is entered by the account holder when the user is created. Webhooks are configured separately: an account holder adds a webhook and selects one of the existing users to associate with it. The report shows that the username value is stored and later rendered in the webhooks interface without being filtered, which turns the username field into a stored cross-site scripting sink.

Setup

No special tooling, role or version is described. The only precondition is a normal account on app.smtp2go.com that can log in and reach the settings area, create SMTP users and add webhooks. The researcher used a screen recording as proof of concept.

Finding it

The researcher's reasoning is that the application does not filter the input provided by the user. The username field accepts arbitrary text, including HTML markup, and that value is later displayed in the webhooks section. Because the stored value is rendered without sanitisation, a script embedded in the username executes in the browser of whoever views the webhooks page.

The report classifies this as stored (persistent) XSS and notes that it is more damaging than non-persistent XSS because the payload is injected directly into the vulnerable application and persists there.

Exploitation

Step 1: create an account and log in

Create an account at https://app.smtp2go.com and log in with a username and password.

Step 2: reach the SMTP users page

After login you are redirected to the dashboard. Click on settings, then on SMTP users.

Step 3: create an SMTP user with a payload as the username

Click on Add SMTP USER and enter the following payload as the username, then save it:

HTML
&#00;</form><input type&#61;"date" onfocus="alert(1)">

The payload contains a closing </form> tag, an input element with a type attribute and an onfocus handler that calls alert(1).

Step 4: add a webhook for that user

Scroll down, click on webhooks, continue, then click ADD WEBHOOK. From the users list select the user created in step 3. When that user is selected in the webhooks interface, the stored payload is rendered and the pop-up fires.

The researcher attached a proof-of-concept recording.

bandicam_2020-07-01_14-55-16-300.mp4 From the original on HackerOne

Root cause

The username supplied at user creation is stored and later output into the webhooks page without filtering or encoding, so markup in the username becomes live HTML in the page. The report states plainly that the website is not filtering the input provided by the user, which is why the problem exists. The report says the website is not filtering the input provided by the user; it does not describe the server-side or client-side code involved.

Impact

The report frames the impact conditionally: if one of these users executes the malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user, such as stealing the user's cookies. The payload shown only calls alert(1), so the demonstrated effect is script execution in the context of the webhooks page; the wider consequences listed are the researcher's description of what stored XSS can enable, not something demonstrated in the recording.

Fix

The report does not describe any fix or remediation that was applied. The change it implies is to stop treating the username as markup: filter or encode the value on input and, more importantly, encode it on output wherever it is rendered, including the webhooks user selection, so that stored HTML cannot break out of its context.

Variants to test

  • Try the same payload in other free-text fields that are later displayed in a different part of the application, such as names, labels or descriptions. A positive result is the payload rendering as markup and the handler firing when the field is viewed.
  • Try payloads that do not rely on onfocus, for example elements that execute on load, in case the injected element is never focused. A positive result is execution without user interaction.
  • Try breaking out of different surrounding contexts (attribute values, script blocks, table cells) rather than a </form> tag, since the correct break-out depends on where the value is rendered. A positive result is the same pop-up or any script execution in the page.
  • Try the payload in a username that is referenced from several screens, to see whether only the webhooks view is vulnerable or every place the username is displayed. A positive result is execution on more than one page.

Hunting notes

This bug lives in secondary features that echo user-controlled names: selection lists, dropdowns and association widgets that pull a stored label from another object. The signal during recon is a field whose value is entered once and then displayed in several places, especially where the display is built dynamically.

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. 8 min read.

What happened, in plain words

SMTP2GO is a service that sends email for you. If you run a website or an app and you want it to send things like password reset emails or order confirmations, you can hand those emails to SMTP2GO instead of running your own mail server. The part of the service described here is the customer-facing website at app.smtp2go.com, where an account holder logs in to manage their settings.

Two features of that settings area matter for this report:

  • SMTP users: these are the login details (a username and a password) that an account holder creates so that their own software can connect to SMTP2GO and send mail. Think of them as keys cut for a building: each key belongs to one door and one purpose.
  • Webhooks: a webhook is an automatic notification. Instead of your software constantly asking SMTP2GO "did anything happen yet?", you tell SMTP2GO "when something happens, send a message to this address of mine". Here, the account holder adds a webhook and picks one of the existing SMTP users to go with it.

The researcher found that the username you type when creating an SMTP user is not filtered, and is later shown on the webhooks page. If the username contains pieces of a web page (HTML), the browser treats those pieces as real page content rather than as harmless text. That lets someone slip a small program (a script) into the page, and the browser runs it. This kind of bug is called stored cross-site scripting, or stored XSS: "stored" because the bad value is saved on the server and comes back later, and "cross-site scripting" because code from one place ends up running inside another page.

Context

The target is the settings area of app.smtp2go.com, specifically the SMTP users feature and the webhooks feature next to it. The username is entered once by the account holder when the user is created. The webhooks screen later displays that username. Because the value is not filtered, the username field becomes a place where stored XSS can be planted.

A quick word on the terms used from here on:

  • Input: anything you type into a form on a website. The username box is an input.
  • Filtering / sanitising: cleaning or checking what was typed so that dangerous characters are removed or defused before the value is used.
  • Encoding: rewriting special characters so the browser shows them as text instead of acting on them. For example, showing the characters < and > on screen rather than treating them as the start and end of an HTML tag.
  • HTML: the language web pages are written in. It uses tags such as <form> and <input> to describe boxes, buttons and forms.
  • Script: a small program that runs inside your browser. JavaScript is the usual language for this.
  • Cookie: a small piece of data a website asks your browser to keep and send back with later requests, often used to remember that you are logged in. If someone can run their own script in a page you are viewing, that script can read what the page can read, which is why cookies come up in XSS reports.

Setup

The report describes no special tools, no particular user role and no software version. The only thing needed is an ordinary account on app.smtp2go.com that can log in, open the settings area, create SMTP users and add webhooks. The researcher recorded the screen while reproducing the bug, and that recording is the proof of concept.

Finding it

The researcher's reasoning is simple: the application does not filter what the user types. The username box accepts any text, including HTML markup, and that text is later displayed in the webhooks section. Because the saved value is shown without being made safe, a script hidden in the username runs in the browser of anyone who opens the webhooks page.

The report calls this stored (persistent) XSS and notes that it is more damaging than non-persistent XSS, because the payload is planted directly in the vulnerable application and stays there. To picture the difference: non-persistent XSS is like writing a rude word on a whiteboard that gets wiped after one person reads it; stored XSS is like carving it into the desk, where every person who sits down afterwards sees it.

Exploitation

Step 1: create an account and log in

Create an account at https://app.smtp2go.com and log in with a username and password. This is just the normal way in: you need to be inside the application to reach the settings pages, and the bug lives behind the login.

Step 2: reach the SMTP users page

After login you land on the dashboard. Click on settings, then on SMTP users. This is where the account holder manages the credentials their software uses to send mail, and it is where the username that will carry the payload gets created.

Step 3: create an SMTP user with a payload as the username

Click on Add SMTP USER, type the following payload into the username field, and save it:

HTML
&#00;</form><input type&#61;"date" onfocus="alert(1)">

Step 4: add a webhook for that user

Scroll down, click on webhooks, continue, then click ADD WEBHOOK. From the list of users, select the user you created in step 3. When that user is selected in the webhooks interface, the saved payload is displayed as live page content and the pop-up fires.

The researcher attached a recording of the proof of concept.

bandicam_2020-07-01_14-55-16-300.mp4 From the original on HackerOne

Root cause

The username given at user creation is saved and later written into the webhooks page without filtering or encoding. That means markup in the username becomes live HTML in the page instead of being shown as text. The report says plainly that the website is not filtering the input provided by the user, and that this is why the problem exists. The report says the website is not filtering the input provided by the user; it does not describe the server-side or client-side code involved.

Impact

The report describes the impact conditionally: if one of these users runs the malicious content, the attacker may be able to perform privileged operations on behalf of the user, or gain access to sensitive data belonging to the user, such as stealing the user's cookies. The payload shown only calls alert(1), so what was actually demonstrated is script execution in the context of the webhooks page. The wider consequences are the researcher's description of what stored XSS can enable, not something shown in the recording.

Fix

The report does not describe any fix or remediation that was applied. The change it implies is to stop treating the username as markup: filter or encode the value on input and, more importantly, encode it on output wherever it is displayed, including the webhooks user selection, so that stored HTML cannot break out of its context.

Variants to test

  • Try the same payload in other free-text fields that are later displayed elsewhere in the application, such as names, labels or descriptions. A positive result is the payload appearing as markup and the handler firing when the field is viewed.
  • Try payloads that do not rely on onfocus, for example elements that run as soon as they load, in case the injected element is never focused. A positive result is execution without any user interaction.
  • Try breaking out of different surrounding contexts (attribute values, script blocks, table cells) rather than a </form> tag, since the right break-out depends on where the value is displayed. A positive result is the same pop-up or any script execution in the page.
  • Try the payload in a username that is referenced from several screens, to see whether only the webhooks view is vulnerable or every place the username appears. A positive result is execution on more than one page.

Hunting notes

This bug lives in secondary features that echo names the user controls: selection lists, dropdowns and association widgets that pull a saved label from another object. During recon, the signal is a field whose value is entered once and then displayed in several places, especially where the display is built dynamically. The researcher attached a proof-of-concept recording.

Glossary

  • SMTP: the standard protocol for sending email between computers. SMTP2GO is a service that sends mail on your behalf using it.
  • SMTP user: a username and password created inside SMTP2GO so that your own software can log in and send mail through the service.
  • Webhook: an automatic notification sent to an address you choose when something happens, instead of your software repeatedly asking whether it happened.
  • Dashboard: the main screen you see after logging in.
  • Input: anything typed into a form on a website.
  • Filtering / sanitising: cleaning or checking typed values so dangerous characters are removed or defused.
  • Encoding: rewriting special characters so the browser shows them as text rather than acting on them.
  • HTML: the language web pages are written in, using tags such as <form> and <input>.
  • Tag: a piece of HTML such as <form> or <input> that describes part of a page.
  • Attribute: a setting written inside an HTML tag, such as type or onfocus.
  • Character reference: a code such as &#61; that the browser turns into a character (here, an equals sign) when displaying the page.
  • Script: a small program that runs inside your browser, usually in JavaScript.
  • Event handler: an instruction attached to an element that runs when something happens to it, such as onfocus.
  • onfocus: an event that fires when an element receives focus, for example when it is clicked or tabbed into.
  • alert(1): a browser command that shows a pop-up box containing the number 1, often used to prove that code ran.
  • Cross-site scripting (XSS): a bug where someone's code ends up running inside a web page viewed by someone else.
  • Stored (persistent) XSS: XSS where the malicious value is saved on the server and shown to whoever views the affected page later.
  • Non-persistent XSS: XSS where the malicious value is not saved and only affects the single request or page load that carries it.
  • Payload: the piece of text or code crafted to trigger the bug.
  • Proof of concept (PoC): a demonstration that the bug really works, here a screen recording.
  • Severity: a rating of how serious a bug is; this report rates it medium.
  • Recon: the exploratory phase of looking around an application to spot weak points.
  • Context: the surrounding place in the page where a value is displayed, such as inside a form, an attribute or a script block; breaking out depends on it.

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.