Skip to content
XSS Disclosed report Beginner

Reflected - XSS

A reflected cross-site scripting flaw was reported on a web page, where text entered into a message field was echoed back into the page without proper handling. An attacker could craft a link that runs script in a victim's browser, potentially stealing session data or acting as the user.

vidaamuyarchi Follow

Originally disclosed on HackerOne

  • Triaged in 28 hours
  • Fixed in 2 months
  • Disclosed after 23 months

Summary by the researcher

POC Video :- https://youtu.be/HLshcsX1GwU?si=BM0VLLNjbM8ZwBbi

The report

Summary:

Hi, Team I'm Found Reflected XSS

Steps To Reproduce:

1.Nave to https://www.mtn.bj/ 2.Go to Messages 3. Enter XSS Payload :

* <h1 onauxclick=confirm(document.domain)>RIGHT CLICK HERE
  1. Reflected the popup

Impact

Cross site scripting attacks can have devastating consequences. Code injected into a vulnerable application can exfiltrate data or install malware on the user's machine. Attackers can masquerade as authorized users via session cookies, allowing them to perform any action allowed by the user account.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is mtn.bj, the MTN Group site in Benin, and the feature involved is the Messages section of the site. The report describes a reflected cross-site scripting issue. It does not record a bounty amount or a fix.

The reproduction steps are short and direct:

  1. Navigate to https://www.mtn.bj/
  2. Go to Messages.
  3. Enter the following payload:
HTML
<h1 onauxclick=confirm(document.domain)>RIGHT CLICK HERE
  1. The popup is reflected.

In other words, the payload is submitted through the Messages feature, comes back in the response, and the browser parses it as HTML. The onauxclick handler is meant to fire on a non-primary click, and when it does, confirm(document.domain) would run in the page's origin. The report includes proof-of-concept video links.

Or watch on YouTube
From the original on HackerOne

A second video link is also included in the report:

Text
https://youtu.be/gT-0RwW0mRM?si=yUhC-N1Hk33pcBwj
Or watch on YouTube
From the original on HackerOne

It also does not describe any filtering that was bypassed, so the only technical detail available is the payload itself and the reported popup.

Root cause

A likely cause is that the Messages feature reflects user input into the HTML response without context-aware output encoding. Because the input is placed where the browser expects markup, the <h1> element is created and its event handler attribute is registered. The researcher describes the issue as reflected XSS.

Impact

The report's impact statement is general: injected code can exfiltrate data or install malware on the user's machine, and an attacker can masquerade as an authorised user through session cookies, performing any action the account allows. Those consequences depend on what the application exposes to script running in its origin, and the report does not demonstrate data theft or session abuse, only script execution.

How this kind of bug works

Reflected XSS happens when an application copies a value from the request into the response body, an attribute, a script block or a URL context, and the browser interprets part of that value as code or markup. The server treats the input as data; the browser treats it as instructions. The vulnerability exists because the output context is not respected: HTML body, attribute value, JavaScript string, CSS and URL contexts each need different escaping, and a single generic filter rarely covers all of them.

Execution requires a victim to load a crafted URL or submit a crafted form, so delivery usually relies on a link. Once the script runs, it inherits the origin of the page, which means it can read the DOM, make same-origin requests with the user's cookies (subject to HttpOnly on the session cookie, which blocks reading the cookie value but not acting with it), and rewrite the page to phish for credentials.

Defences that stop it are output encoding matched to context, a restrictive Content Security Policy that blocks inline handlers and inline script, and correct handling of the Content-Type and X-Content-Type-Options headers so browsers do not sniff HTML where it is not intended. Input validation helps but is not the primary control; encoding at the point of output is.

How to test for it

Start by mapping every place where user input comes back in a response: search boxes, message or comment forms, error pages, redirect parameters, language selectors, and any parameter whose value appears in the page. Submit a unique alphanumeric marker first and locate it in the response with a proxy or browser developer tools.

Once you know where the marker lands, determine the context. If it sits between tags, test whether a new element is created. If it sits inside an attribute, test whether the attribute can be closed and a handler added. If it sits inside a script block, test whether a string can be broken out of. If it lands in a URL or a href, test whether a javascript: scheme survives.

A positive result is the browser executing your marker, for example a dialog showing the document domain, or a callback to a listener you control. Confirm it in a real browser rather than only in the raw response, because the response alone does not prove parsing. Check whether the payload survives URL decoding, whether the server strips angle brackets or quotes, and whether the reflection is HTML-encoded (&lt;, &quot;) rather than live.

Common false positives: the value appears encoded in the source but a tool flags the raw parameter; the reflection only occurs in a response with a non-HTML content type; the payload executes only after you modify the DOM yourself in developer tools; or a browser's built-in XSS auditor (where still present) blocks execution, which is not a server-side fix. Also watch for reflections inside JSON that are later inserted with innerHTML by client-side code, which is a real issue but needs a different proof.

How it is fixed

Apply context-aware output encoding to every reflected value, using the framework's escaping helpers rather than hand-written replacements. Avoid inserting user input into inline event handlers or inline script; pass data through safe APIs such as textContent or a templating engine with auto-escaping. Add a Content Security Policy that disallows inline script and inline handlers, which limits the damage of any encoding mistake that remains. Set Content-Type: text/html only where HTML is intended, and send X-Content-Type-Options: nosniff. Where the value is used in a URL, validate the scheme against an allowlist.

Hunting notes

Reflected XSS tends to hide in features that echo input back for convenience: search results pages, "no results for X" messages, form validation errors, message and feedback forms, and parameters used to preselect a language or tab. Older or locally maintained sites, marketing microsites and regional portals are frequent candidates because they are often built outside the main application's security review.

Recon signals worth following: parameters that appear in the page body rather than only in logs, endpoints that return HTML for values you did not expect, and any feature that reflects a name or message back to the user. Crawl with a proxy and grep responses for your markers.

A clear video or screenshot of the dialog showing the domain, plus the request that produced it, is usually enough for a reflected XSS report to be triaged.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 8 min read.

What happened, in plain words

This report is about a website belonging to MTN Group, the telecoms company, specifically its site for Benin at mtn.bj. The researcher found a bug in the Messages section of that site. The bug is called reflected cross-site scripting, often shortened to XSS.

To understand the bug, you need one idea first: a web page is not just text on a screen. When your browser receives a page from a server, it reads the page as a set of instructions about what to display. Some of those instructions say "show a heading here", "show a button there". If a website takes something you typed and pastes it into those instructions without cleaning it, your browser will treat what you typed as instructions too. That is the heart of XSS: the site thinks your input is just data, but the browser treats it as code.

The word "reflected" means the input is not saved anywhere. You send it, the site sends it straight back to you in the page it returns, and then it is gone. Think of a shop assistant who repeats your question back to you word for word. If you ask something rude, the assistant is not being rude, they are just repeating you. Here, the site repeats the input, and the browser obeys it.

The steps in the report

The researcher's reproduction steps are short:

  1. Navigate to https://www.mtn.bj/
  2. Go to Messages.
  3. Enter the following payload:
HTML
<h1 onauxclick=confirm(document.domain)>RIGHT CLICK HERE
  1. The popup is reflected.

Let us go through each step and the payload line by line, because the payload is the whole trick.

Step 1 is simply opening the site in a browser. Nothing special happens yet; this is just the starting point.

Step 2 is finding the Messages feature, where the payload is entered. That is exactly the kind of feature where reflected XSS lives, because the site has to handle text the visitor supplied.

Step 3 is where the payload goes. A payload is just the text you feed in to test whether the site mishandles it. Here it is:

HTML
<h1 onauxclick=confirm(document.domain)>RIGHT CLICK HERE

Breaking it down:

  • <h1 ...> is an HTML tag. HTML is the language browsers use to describe page structure, and h1 means "a large heading". The opening < tells the browser "an instruction starts here".
  • onauxclick=... is an attribute on that tag. Attributes are extra settings on an element. This particular one is an event handler: a piece of code the browser runs when something happens. auxclick means a click with a button other than the main one, for example the middle mouse button.
  • confirm(document.domain) is the code that runs when that click happens. document.domain asks the browser "what is the address of the page I am on?", and confirm(...) shows a small pop-up box with that answer and an OK button.
  • RIGHT CLICK HERE is just the visible text of the heading, there to tell a person where to click.

So the payload says: "make a big heading that says RIGHT CLICK HERE, and if someone middle-clicks it, show a pop-up with the site's address." If the site pastes that text into the page as-is, the browser builds a real heading with a real event handler, and the pop-up appears. That pop-up is the proof: it means the browser ran code that came from the visitor, not from the site.

Step 4 is the result: the researcher reports that the popup was reflected. The report includes a proof-of-concept video link:

Or watch on YouTube
From the original on HackerOne

A second video link is also given:

Text
https://youtu.be/gT-0RwW0mRM?si=yUhC-N1Hk33pcBwj
Or watch on YouTube
From the original on HackerOne

The report does not say which field or parameter carried the payload, which HTTP method was used, or what the raw response looked like. It also does not describe any filter that was bypassed. The only technical facts available are the payload and the reported popup.

Why it matters

The report's impact section is general rather than specific. It says injected code can steal data or install malware on a user's machine, and that an attacker can pretend to be a logged-in user by abusing session cookies, doing anything that user's account is allowed to do.

A session cookie is a small piece of data your browser stores after you log in, and sends with every request so the site knows who you are. Think of it as a wristband at an event: show it and you get in without proving who you are again. If an attacker can run their own code inside the site's pages, that code runs with the same wristband, so it can act as the victim. The report does not demonstrate any data theft or account abuse; it shows script execution, and the real limit of the damage depends on what the site lets a logged-in user do.

In general, how this kind of bug works

Reflected XSS happens when a site copies a value from your request into its response, and the browser reads part of that value as markup or code. The server thinks it is handling data; the browser thinks it is being given instructions. The root problem is that the value is placed into the page without being escaped for the place it lands. A value inside a heading, inside an attribute, inside a script block and inside a link each need different treatment, and one generic filter rarely covers all of them.

For the attack to work, a victim has to load a crafted link or submit a crafted form, so delivery usually depends on someone clicking a link. Once the code runs, it belongs to the page's origin, meaning the site's own address. It can read the page, make requests as the logged-in user, and rewrite the page to ask for a password. A cookie marked HttpOnly cannot be read by script, but the script can still act with the session it represents.

The main defences are output encoding matched to where the value lands, a Content Security Policy that blocks inline handlers and inline script, and correct Content-Type and X-Content-Type-Options headers so browsers do not guess that something is HTML when it is not. Input validation helps, but encoding at the point of output is the primary control.

In general, how to test for it

  1. Find every place where what you type comes back in the page: search boxes, message forms, error pages, redirect parameters, language selectors.
  2. Type a unique marker, something like a random word, and find it in the response using your browser's developer tools or a proxy. A proxy is a tool that sits between your browser and the site and lets you see the traffic.
  3. Work out the context. Between tags, try to create a new element. Inside an attribute, try to close it and add a handler. Inside a script block, try to break out of the string. In a link, try a javascript: address.
  4. Confirm in a real browser, not just in the raw response, because the response alone does not prove the browser parsed it as code.

Watch for false positives: the value may appear encoded in the page source while a tool flags the raw parameter; the reflection may only appear in a response that is not HTML; the payload may only run after you edit the page yourself in developer tools; or a browser's built-in XSS filter may block it, which is not a server-side fix. Also watch for values reflected inside JSON that client-side code later inserts into the page, which is a real issue but needs a different proof.

In general, how it is fixed

Apply context-aware output encoding to every reflected value, using the framework's escaping helpers rather than hand-written replacements. Do not put user input into inline event handlers or inline script; pass data through safe APIs such as textContent or a templating engine that escapes automatically. Add a Content Security Policy that disallows inline script and inline handlers. Send Content-Type: text/html only where HTML is intended, and add X-Content-Type-Options: nosniff. Where a value is used in a URL, check the scheme against an allowlist.

In general, where to look

Reflected XSS hides in features that echo input back for convenience: search results, "no results for X" messages, form validation errors, message and feedback forms, and parameters that preselect a language or tab. Older or locally maintained sites, marketing microsites and regional portals are common candidates because they are often built outside the main application's security review. Signals worth following are parameters that show up in the page body, endpoints that return HTML for values you did not expect, and any feature that reflects a name or message back to you.

A clear video or screenshot of the pop-up showing the domain, plus the request that produced it, is usually enough for a reflected XSS report to be triaged.

Glossary

  • Reflected XSS: XSS where the input is sent straight back in the response and not stored.
  • Payload: the text you submit to test whether a site mishandles input.
  • HTML: the language browsers use to describe the structure of a page.
  • Tag: an HTML instruction such as <h1>, marking the start of an element.
  • Attribute: an extra setting on an HTML tag, such as an event handler.
  • Event handler: code the browser runs when something happens, such as a click.
  • auxclick: the browser event for a click with a button other than the main one, such as the middle button.
  • document.domain: a browser property that returns the address of the current page.
  • confirm(): a browser function that shows a small pop-up with a message and an OK button.
  • Session cookie: a small piece of data stored by the browser after login and sent with requests so the site recognises the user.
  • HttpOnly: a cookie setting that stops script from reading the cookie value.
  • Origin: the combination of scheme, host and port that identifies a site to the browser.
  • Output encoding: converting characters so the browser treats a value as data, not code.
  • Content Security Policy (CSP): a header that tells the browser which sources of script and other content are allowed.
  • Content-Type: a header that states what kind of content a response contains.
  • X-Content-Type-Options: nosniff: a header that stops the browser guessing a content type.
  • Proxy: a tool between browser and site that lets you inspect and modify traffic.
  • False positive: a finding that looks like a bug but is not exploitable in practice.
  • textContent: a safe way to put text into a page without it being parsed as HTML.
  • Allowlist: a list of values that are explicitly permitted.

More by vidaamuyarchi

View all

1 more disclosed report, best first.

More from MTN Group

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.