Stored XSS in nameserver field on account settings page
The nameserver field on the account settings page lacked input validation and output encoding, allowing a stored cross-site scripting payload to execute when the page was reloaded. The reporter notes this is self-XSS only, affecting the account owner who injects the payload and not other users.
- Triaged in 15 days
- Fixed in 33 days
- Disclosed after 4 months
Summary by the program
The reporter has discovered a stored XSS vulnerability in the nameserver field on the account settings page. By intercepting and modifying the PUT request when saving nameserver settings, they were able to inject malicious JavaScript code that executes when the settings page is reloaded. The reporter explicitly notes this is a self-XSS vulnerability, meaning it only affects the account owner who injects the payload and cannot directly impact other users.
The report
Summary:
The lack of input validation and weak CSP configuration on the account settings page leads to a stored XSS vulnerability
Steps To Reproduce:
- Go to this address: https://www.████████.com/signin/
- Sign in to your account
- Click on “Settings” in the upper-left corner of the screen
- Click “Edit” next to the “Nameservers” text
- Click “Save Namerservers” without making any changes, and intercept this request in Burp
- Send the request with the HTTP method PUT to Repetar on the Intercept page
- Close Intercept
- Replace any nameserver value in the request you sent to Repetar with this XSS code:
<img/src=x onerror=alert(document.domain)> - Click “Send” on the request in Repetar
- Refresh the page and observe a pop-up opening with
www.████████.comwritten on the screen
Responsible Disclosure:
- The stored XSS vulnerability is found on the account settings page. I was unable to find any evidence of how it could affect other users. This vulnerability could be exploited through account sharing
Supporting Material/References:
- ████████
Impact
This stored XSS vulnerability allows injection of JavaScript code that executes in the context of the ████████.com domain when visiting the nameserver settings page.
Self-XSS Limitation: The vulnerability is limited to a self-XSS scenario - only the account owner who injected the payload can see and be affected by the XSS execution when visiting their own account settings page. Other users cannot access or view another user's account settings page.
Limited Security Impact: Due to the self-affecting nature:
- No direct impact on other users or accounts
- Cannot be used to attack other ████████.com users
- Requires the attacker to compromise their own session/account
Potential Scenarios: The primary security concern would be in limited scenarios such as:
- Shared computer environments where multiple users access the same ████████.com account
- Social engineering attacks where a user is tricked into injecting malicious code into their own account
- Demonstration of inadequate input validation that could indicate broader security issues
Technical Significance: While the practical impact is minimal, this demonstrates a lack of proper input validation and output encoding in the nameserver configuration functionality, which represents a security weakness in the application's handling of user input.
Context
The target is the Hover account settings page, part of the Tucows vulnerability disclosure programme and scoped to *.hover.com. The feature in question is the nameserver configuration: from the settings page a signed-in account owner can edit the nameservers associated with their account and save them. Saving the form issues an HTTP PUT request that carries the nameserver values.
The report describes a stored cross-site scripting issue in that nameserver field. The payload is injected by modifying the PUT request in transit, is persisted by the application, and executes when the settings page is reloaded. The reporter is explicit that this is a self-XSS: only the account owner who injected the payload is affected.
Setup
- A normal account on the target site, signed in through the sign-in page.
- Burp Suite, used as an intercepting proxy. The report refers to the Repeater tab (spelled "Repetar" in the original) for resending the captured request.
- No special role or privilege is required beyond being able to reach your own account settings and edit nameservers.
- The precondition for the payload to fire is that the account owner reloads the nameserver settings page after the modified request has been accepted.
Finding it
The reporter's summary attributes the issue to two things: a lack of input validation on the nameserver field, and a weak Content Security Policy configuration on the account settings page. The reporter attributes the issue to a lack of input validation on the nameserver field and a weak CSP configuration on the account settings page. The weak CSP is cited as the reason the injected script is not blocked.
Exploitation
Step 1: reach the sign-in page
The starting point given in the report is the sign-in address, with the hostname redacted:
https://www.████████.com/signin/
Step 2: sign in
Authenticate to your own account. Everything that follows happens inside that account's settings.
Step 3: open Settings
Click "Settings" in the upper-left corner of the screen.
Step 4: edit the nameservers
Click "Edit" next to the "Nameservers" text. This exposes the nameserver values for editing.
Step 5: capture the save request
Click "Save Namerservers" without making any changes, with Burp intercepting. The request that the page sends to persist the nameservers is the one you keep.
Step 6: send it to Repeater
With the request held on the Intercept page, send it to Repeater using the PUT method, then close Intercept. From here the request is edited and replayed by hand rather than through the browser form.
Step 7: inject the payload
Replace any nameserver value in the replayed request with the following payload:
<img/src=x onerror=alert(document.domain)>
The payload is an img element whose src is the invalid path x, so the image load fails and the onerror handler runs. The handler calls alert(document.domain), which proves execution in the origin of the settings page rather than in some sandboxed or unrelated context. The missing space between img and /src is part of the payload as sent.
Step 8: send the modified request
Click "Send" in Repeater. The server accepts the modified nameserver value and stores it.
Step 9: reload and observe
Refresh the nameserver settings page. A pop-up opens showing www.████████.com, the domain of the page, confirming that the stored value is rendered as HTML and that the handler executes in the page's origin.
Root cause
The reporter attributes the issue to a lack of input validation on the nameserver field and a weak CSP on the account settings page, which is why the injected handler is not blocked. The report also points to a weak CSP on the account settings page as the reason the inline handler is not stopped; a policy that disallowed inline script and event handler attributes would have blocked the onerror execution even with the encoding flaw present. Both points are stated by the reporter as the cause; the exact server-side code is not shown.
Impact
The reporter is careful about scope. The script executes in the context of the domain when the nameserver settings page is visited, but only the account owner who injected the payload sees it. Other users cannot access or view another user's account settings page, so there is no direct impact on other users or accounts and the issue cannot be used to attack other users of the site. Exploiting it requires the attacker to compromise their own session or account.
The scenarios the reporter lists as the remaining concern are:
- Shared computer environments where several people use the same account.
- Social engineering in which a user is tricked into injecting malicious code into their own account.
- The broader signal that input validation is inadequate, which could point to related weaknesses elsewhere.
The reporter also notes that the vulnerability could be exploited through account sharing. The platform rated the issue low severity.
Fix
The report does not describe a fix or a change made by the vendor. Based on the stated cause, the two things to address are validation or encoding of the nameserver value on input and output, so that stored values are rendered as text rather than markup, and a stricter CSP on the settings page that disallows inline event handlers, so that an injected handler cannot execute even if encoding fails.
Variants to test
- Other fields on the same settings page that are saved by a
PUTand rendered back, such as contact or account details. A positive result is the samealert(document.domain)firing after a reload. - Different payload shapes against the same field, for example other elements with failing loads or handlers, to see whether only
imgis filtered. A positive result is any handler executing after the value is stored and the page reloaded. - The same nameserver field reached through the normal form rather than Repeater, to check whether client-side validation is the only barrier. A positive result is the payload being accepted and stored without proxying.
- The CSP itself: check which directives are present on the settings page and whether inline handlers are permitted. A positive result is a policy that allows the injected handler to run, which is what the report attributes the execution to.
- Multi-user access to a single account, to see whether a second user viewing the same settings sees the stored value execute. A positive result would move the issue beyond self-XSS, which the reporter did not find.
What happened, in plain words
A security researcher found a way to make a website store a small piece of JavaScript code in one of its settings fields, and then run that code every time the settings page was opened. The website is Hover, a domain registrar, and the work was done under the Tucows vulnerability disclosure programme, which covers addresses ending in *.hover.com. The researcher reported it through HackerOne under the name axolot23, and the platform rated it low severity.
The field in question is the nameserver field. A nameserver is the part of the internet that tells browsers and other computers which server holds a domain's records, so it is a setting a domain owner genuinely needs to edit. On the account settings page, a signed-in owner can change their nameservers and save them. When the form is saved, the browser sends a request to the server using a method called PUT, and that request carries the nameserver values.
The researcher did not type the malicious value into the form. Instead, they caught the outgoing request with a tool called Burp Suite, changed one nameserver value inside it, and sent it on. The server accepted the changed value and saved it. When the settings page was reloaded, the saved value was placed back into the page as if it were part of the page's own code, and the code ran.
The important limitation, which the researcher states clearly, is that this is a self-XSS. Only the person who injected the value, using their own account, sees it run. Nobody else can open another person's account settings page, so no other user is affected. That is why the severity is low.
The pieces you need to know
Before walking through the steps, here are the ideas the report relies on, explained from scratch.
A web request. When you click a button on a website, your browser sends a message to a server and the server sends one back. That message is an HTTP request. It has a method (a verb saying what kind of action it is), an address, and usually some data attached.
The PUT method. HTTP methods describe intent. GET means "give me something", POST usually means "here is new data, create something", and PUT usually means "here is data, store it at this address". Saving the nameserver form sends a PUT request carrying the new nameserver values. Think of it like handing a form to a clerk and saying "replace what you have on file with this".
An intercepting proxy. Normally your browser talks straight to the server. A proxy sits in the middle: your browser talks to the proxy, and the proxy talks to the server. Burp Suite is a proxy you run on your own computer. When it is set to intercept, it pauses each request so you can read it, change it, and then let it continue. It is like a postal worker who lets you open every letter before it is delivered.
Repeater. Burp Suite has a tab called Repeater (spelled "Repetar" in the report) where you can take a captured request, edit it, and send it again as many times as you like, without touching the browser form. This matters because the browser form may have its own checks; Repeater lets you talk to the server directly.
Input validation. This is the server checking that what it receives makes sense before accepting it. If a field is supposed to hold a hostname like ns1.example.com, validation would reject anything that is not a plausible hostname. The report says this check is missing on the nameserver field.
Output encoding. This is the opposite side of the same coin. When the server puts a stored value back into a web page, it should mark the value as text, so that characters like < and > are shown as characters rather than treated as the start of HTML markup. If a value is inserted without encoding, the browser cannot tell the difference between the site's own markup and something a user stored.
Stored cross-site scripting (XSS). XSS is when an attacker gets their own code to run inside a page belonging to someone else's site. "Stored" means the malicious value is saved on the server first and runs later, every time the page is loaded, rather than running immediately in a single response. The everyday comparison: imagine a guestbook where the site prints whatever visitors write. If a visitor writes a note that says "when you read this, clap your hands", the site will print that instruction and every later reader will follow it. Encoding the note as plain text would stop that.
Self-XSS. A special, much weaker case: the only person who can trigger the code is the person who put it there, in their own account. It is like writing a prank note and hiding it in your own desk drawer. It is still a flaw, because the site should not store executable markup at all, but it cannot be used against anyone else.
Content Security Policy (CSP). A CSP is a set of instructions a website sends to the browser saying which kinds of code are allowed to run on its pages. It is a second line of defence: even if a bad value slips into the page, a strict policy can stop it from executing. The report says the CSP on the account settings page is weak, which is why the injected code was not blocked.
document.domain. In a browser, document is the object representing the current page, and document.domain is the page's domain name. Showing it in a pop-up is a common way to prove that code ran in the context of the real site, not somewhere unrelated.
Setup
To reproduce this you need:
- A normal account on the target site, signed in through the sign-in page. No special role or extra privilege is needed beyond being able to open your own account settings and edit nameservers.
- Burp Suite, running as an intercepting proxy, with its Repeater tab available for resending the captured request.
- One precondition: after the modified request has been accepted, the account owner has to reload the nameserver settings page for the stored value to run.
Finding it
The researcher's summary names two causes. First, the nameserver field has no input validation, so the server accepts a value that is not a real nameserver. Second, the account settings page has a weak Content Security Policy, so the browser does not block the code that ends up in the page. The value is stored and then rendered back into the settings page, and the weak CSP means the injected code is not blocked when the page is reloaded.
Exploitation
Step 1: reach the sign-in page
The report gives the sign-in address, with the hostname redacted:
https://www.████████.com/signin/
This is the ordinary login page. The redaction hides the exact domain, but the shape is a normal web address: https is the secure version of the protocol, then the hostname, then the path /signin/.
Step 2: sign in
Log in to your own account. Everything that follows happens inside that account's settings, which is why the impact stays limited to you.
Step 3: open Settings
Click "Settings" in the upper-left corner of the screen. This is the page that holds the nameserver configuration.
Step 4: edit the nameservers
Click "Edit" next to the "Nameservers" text. This reveals the nameserver values so they can be changed. You are not going to change them in the form, though; the next step captures what the form sends.
Step 5: capture the save request
With Burp intercepting, click "Save Namerservers" without making any changes. The browser sends the request that persists the nameservers, and Burp pauses it so you can keep it. The reason for saving without changes is simply to get a valid, complete request to work with; you will edit it by hand in a moment.
Step 6: send it to Repeater
With the request held on the Intercept page, send it to Repeater using the PUT method, then close Intercept. From here on the request is edited and replayed by hand rather than through the browser form, which means any checks the form itself performs no longer apply.
Step 7: inject the payload
Replace any nameserver value in the replayed request with this payload:
<img/src=x onerror=alert(document.domain)>
Line by line, in plain words:
<imgstarts an image element, the same tag a page uses to show a picture./src=xsets the image's source tox. There is no space betweenimgand/src; that is exactly how the payload was sent. Becausexis not a real address, the image will fail to load.onerror=alert(document.domain)attaches an instruction that the browser runs when the image fails to load.alert(...)opens a pop-up box, anddocument.domainis the domain of the current page. So the pop-up will display the site's own domain name.>closes the tag.
The trick is that the failure is guaranteed: the image address is deliberately broken, so the error handler always fires. And because the pop-up shows the page's own domain, it proves the code ran as part of the real site, not in some harmless separate context.
Step 8: send the modified request
Click "Send" in Repeater. The server accepts the modified nameserver value and stores it. This is the moment the missing input validation matters: a value that is obviously not a nameserver is saved without complaint.
Step 9: reload and observe
Refresh the nameserver settings page. A pop-up opens showing www.████████.com, the domain of the page. That confirms two things: the stored value was placed back into the page as HTML rather than as plain text, and the handler ran in the page's own origin.
Root cause
The reporter attributes the issue to a lack of input validation on the nameserver field and a weak CSP on the account settings page. So a value containing an event handler attribute is parsed as markup the next time the page is rendered. The report also points to the weak CSP on the account settings page as the reason the inline handler is not stopped: a policy that disallowed inline script and event handler attributes would have blocked the onerror from running even with the encoding flaw present. Both points are the reporter's stated cause; the exact server-side code is not shown.
Impact
The researcher is careful about scope. The code runs in the context of the domain when the nameserver settings page is visited, but only the account owner who injected it sees it. Other users cannot access or view another user's account settings page, so there is no direct impact on other users or accounts, and the issue cannot be used to attack other users of the site. Exploiting it requires the attacker to compromise their own session or account.
The scenarios the reporter lists as the remaining concern are:
- Shared computer environments where several people use the same account.
- Social engineering in which a user is tricked into injecting malicious code into their own account.
- The broader signal that input validation is inadequate, which could point to related weaknesses elsewhere.
The reporter also notes that the vulnerability could be exploited through account sharing. The platform rated the issue low severity.
Fix
The report does not describe a fix or a change made by the vendor. Based on the stated cause, two things need addressing: validation or encoding of the nameserver value on input and output, so stored values are rendered as text rather than markup, and a stricter CSP on the settings page that disallows inline event handlers, so an injected handler cannot run even if encoding fails.
Variants to test
- Other fields on the same settings page that are saved by a
PUTand rendered back, such as contact or account details. A positive result is the samealert(document.domain)firing after a reload. - Different payload shapes against the same field, for example other elements with failing loads or handlers, to see whether only
imgis filtered. A positive result is any handler executing after the value is stored and the page reloaded. - The same nameserver field reached through the normal form rather than Repeater, to check whether client-side validation is the only barrier. A positive result is the payload being accepted and stored without proxying.
- The CSP itself: check which directives are present on the settings page and whether inline handlers are permitted. A positive result is a policy that allows the injected handler to run, which is what the report attributes the execution to.
- Multi-user access to a single account, to see whether a second user viewing the same settings sees the stored value execute. A positive result would move the issue beyond self-XSS, which the reporter did not find.
Glossary
- API: a defined way for one piece of software to talk to another, like a service counter with set forms to fill in.
- Burp Suite: a tool that sits between your browser and a website so you can read, pause, change and resend requests.
- Content Security Policy (CSP): instructions a site sends to the browser listing which kinds of code are allowed to run on its pages.
- Cross-site scripting (XSS): getting your own code to run inside a page that belongs to someone else's site.
document.domain: the domain name of the page currently open in the browser.- HackerOne: a platform where security researchers report vulnerabilities to organisations.
- HTTP: the language browsers and servers use to exchange requests and responses.
- Input validation: checking that data sent to a server makes sense before accepting it.
- Intercepting proxy: a proxy that pauses traffic so you can inspect and modify it before it is delivered.
- Nameserver: the part of the internet that tells other computers which server holds a domain's records.
- Origin: the combination of scheme, host and port that a page belongs to; code running in a page's origin can act with that site's identity.
- Output encoding: marking stored values as plain text when placing them into a page, so they are not treated as markup.
- Payload: the piece of code or data an attacker sends to trigger a vulnerability.
PUT: an HTTP method meaning "store this data at this address", typically used to save or replace a value.- Repeater: a Burp Suite tab for editing and resending a captured request by hand.
- Self-XSS: an XSS flaw where only the person who injected the code, in their own account, is affected.
- Severity: a rating of how serious a vulnerability is, here low.
- Stored XSS: XSS where the malicious value is saved on the server and runs later whenever the page is loaded.
- Vulnerability disclosure programme (VDP): a scheme where an organisation invites researchers to report security issues, here run by Tucows.