Skip to content
XSS Write-up Beginner

My Hall of Fame at United Nations Success Story

A reflected cross-site scripting vulnerability was found in the search field of a United Nations subdomain. An attacker could inject a script that executes when a victim moves their mouse over the search field, potentially stealing data or performing actions on behalf of the user.

Joshua Arulsamy Follow

Published on joshuaarulsamy.medium.com

For anyone aspiring to build a career in cybersecurity, Hall of Fames play a major role, like anyone and everyone as a young aspiring ethical hacker it was my dream too and it was a surprise to me when it turned into a reality one day. Here is how I made my dream come true.

Joshua Arulsamy, on joshuaarulsamy.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

The target in this story is a United Nations owned subdomain, mdgs.un.org, and specifically the page query.asp. The report does not describe what the page is for beyond the presence of a search field, so the feature under test is simply that search input. The goal the researcher set himself was not a bounty but a place in the United Nations Hall of Fame, a public list of people who have reported security issues to the organisation.

The report opens with the point that entry to that Hall of Fame is not as hard as people assume. The researcher argues that common low-severity issues such as clickjacking are widespread on UN sites, and that reporting them to [redacted] is mostly a matter of time rather than skill. What he wanted instead was something that justified the place: a cross-site scripting bug on a UN subdomain.

Photo by Jonathan Ansel Moy de Vitry on Unsplash From the original on joshuaarulsamy.medium.com

Setup

No accounts, roles or special access are involved. The work is black-box reconnaissance against public hosts, and the only tooling mentioned is subdomain enumeration:

  • amass
  • subfinder
  • sublist3r

For absolute beginners the report points to online alternatives, DNSDumpster and VirusTotal. The researcher's advice is to combine several enumeration tools rather than rely on one, so that no subdomain is missed. No versions are given for any of the tools.

Finding it

Enumeration returned a large number of active subdomains, which the researcher estimates at around 8000. One of them stood out: https://mdgs.un.org. He moved on to exploring it and tried brute forcing directories.

That led to a page with a query string in its name:

Text
https://mdgs.un.org/query.asp

The report describes this find as giving him hope that the target had "some juice in it". The page contains a search field, and that field became the injection point.

Photo by Max Bender on Unsplash From the original on joshuaarulsamy.medium.com

Exploitation

Step 1: probe the search field with XSS payloads

The researcher tried various XSS payloads against the search field. One worked:

Text
x" onmouseover=alert(1) x="

The payload is built to break out of a quoted attribute. The leading x" closes whatever attribute value the search term is reflected into, onmouseover=alert(1) adds an event handler that fires when the pointer moves over the element, and the trailing x=" opens a new attribute value so that the rest of the original markup stays syntactically plausible. The report does not show the surrounding HTML, so the exact attribute being escaped is not stated.

Step 2: confirm execution

After the payload was submitted, an alert popup appeared every time the mouse cursor crossed the search field. The researcher classifies the bug as reflected XSS: the payload is echoed back in the response to the same request rather than stored.

Photo by Fauzan Saari on Unsplash From the original on joshuaarulsamy.medium.com

Step 3: report and wait

The vulnerability was reported by email to [redacted] on 19 January. The researcher then waited almost two months. On 16 March his name, Joshua Arulsamy, was added to the Hall of Fame.

Finally, My Name was Added to the Infosec Hall of Fame From the original on joshuaarulsamy.medium.com

The report links to the public list at https://unite.un.org/content/hall-fame/list so readers can find the entry.

Root cause

The report does not include the server-side code or the raw response, so the cause can only be inferred. The behaviour is consistent with the search term being written into an HTML attribute without encoding the double quote, which lets the attacker close the attribute and introduce a new event handler. Because the payload is reflected per request, the page is generating the markup dynamically from user input rather than serving a static form.

Why the existing defences did not stop it is not discussed. The report does not characterise any filtering or contextual constraint on the endpoint.

Impact

The report does not analyse impact beyond calling the finding a reflected XSS. In general terms, a reflected XSS on a UN subdomain would let an attacker craft a link that runs script in the context of that origin when a victim opens it, which could be used to act as the victim on that site or to present convincing content under the UN name. Exploitation requires the victim to follow a crafted URL containing the payload.

Fix

It only records that the issue was reported and that the researcher was added to the Hall of Fame.

Variants to test

These are generalisations from the technique, not things the report claims to have tried:

  1. Try the same attribute-breakout pattern on other reflected parameters, substituting the quote character that matches the context: x" onmouseover=alert(1) x=" for double-quoted attributes, and the single-quote equivalent for single-quoted ones. A positive result is the handler firing when the pointer crosses the injected element.
  2. Try event handlers that do not need pointer movement, such as onfocus with autofocus, since a onmouseover payload depends on the victim interacting with the field. A positive result is script running without any mouse movement.
  3. Try the payload against other legacy .asp pages found during directory brute forcing on the same host, since the same templating pattern is often reused. A positive result is the same reflection behaviour on a different endpoint.
  4. Enumerate further subdomains with a second tool and repeat the search-field test on each, following the researcher's advice to combine enumeration sources. A positive result is any subdomain where the payload is reflected unencoded.

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

What happened, in plain words

A security researcher wanted to get his name onto a public list that the United Nations keeps of people who have reported security problems to it. That list is called the Hall of Fame. Many people assume getting onto it must require rare, expert skills. The researcher's story is that it does not, and that the interesting part is finding a real bug rather than a trivial one.

He went looking for a specific kind of bug called cross-site scripting, usually shortened to XSS, on a website owned by the United Nations. XSS is a way of sneaking a small piece of code into a web page so that the page runs it in someone else's browser. Think of a noticeboard where visitors can pin notes: if the board copies whatever a visitor writes onto a fresh sheet without checking it, someone can write an instruction like "whoever reads this, hand me your keys" and the board will faithfully display it as if it were an official notice. XSS is the web version of that.

He found a search box on a United Nations page that copied what you typed straight back into the page without cleaning it. By typing a carefully crafted string into that box, he made the page pop up a small alert window whenever the mouse passed over the search field. That popup is the standard harmless proof that code is running, and it was enough to report. He emailed the United Nations security team, waited about two months, and on 16 March his name appeared on the Hall of Fame.

Photo by Jonathan Ansel Moy de Vitry on Unsplash From the original on joshuaarulsamy.medium.com

Why the Hall of Fame is not as hard as it looks

The researcher starts by pushing back on the idea that the United Nations Hall of Fame is only for elite hackers. In his view, a very common and low-impact bug called clickjacking is widespread on United Nations sites. Clickjacking is when a page is hidden underneath another page so that a visitor thinks they are clicking one thing but is actually clicking something else, like a transparent sheet of glass over a button. He says you could find those, try to make them sound as serious as possible, and email them to [redacted], the United Nations security contact address. That route, he says, is time consuming rather than difficult.

What he wanted instead was something more interesting and new, something that justified a place on the list. So he set out to find XSS on one of the subdomains the United Nations owns.

A subdomain is a smaller address that sits under a main domain name. If a company owns example.com, then shop.example.com and mail.example.com are subdomains of it. Large organisations own many of them, and each one is a separate website that can have its own bugs. Finding them is therefore the first job.

Photo by Max Bender on Unsplash From the original on joshuaarulsamy.medium.com

Step 1: find the subdomains

The researcher calls subdomain enumeration the core step in finding any vulnerability on any domain. Enumeration simply means making a list: you gather as many subdomain names as you can, then look at each one.

He names three tools he uses personally:

  • amass
  • subfinder
  • sublist3r

These are command-line programs that collect subdomain names from public sources and from guessing. You do not need to know how to install them to follow the story; the point is what they produce, which is a long list of addresses.

For absolute beginners he suggests online alternatives instead, where you type a domain into a web page and it shows you subdomains:

  • DNSDumpster
  • VirusTotal

His advice is to combine several enumeration tools rather than trusting one, so that no subdomain is missed. Each tool draws on different sources, so together they cover more ground. The report gives no version numbers for any of the tools.

Step 2: pick a target and look around

Enumeration returned a lot of active subdomains. The researcher estimates the number at around 8000. One of them caught his attention:

Text
https://mdgs.un.org

This is a United Nations subdomain. He moved on to explore it further and tried brute forcing directories. Directory brute forcing means asking a web server for lots of common folder and file names in a row, such as /admin or /login, to see which ones exist. It is like walking down a corridor trying every door handle instead of being given a map. The report does not say which tool he used for this.

That exploration led him to this page:

Text
https://mdgs.un.org/query.asp

The file name query.asp is all the report gives; it does not describe what the page does. The .asp ending tells you the page is generated by a Microsoft web technology called Active Server Pages, which builds the page on the server each time someone asks for it.

The researcher describes this find as giving him hope that the target had some juice in it, meaning it looked worth investigating.

Step 3: try XSS payloads in the search field

A payload, in this context, is the exact piece of text you type into an input to test whether the site mishandles it. He tried various XSS payloads against the search field. One did:

Text
x" onmouseover=alert(1) x="

Here is what each part is doing, in plain words:

  • x" is a letter followed by a double quote. The double quote is the important character. Web pages are written in a language called HTML, where pieces of text are wrapped in quotes, for example value="something". If the search box copies your text into one of those quoted spots without cleaning it, that double quote closes the spot early, exactly like putting a full stop in the middle of a sentence so you can start a new one.
  • onmouseover=alert(1) is an instruction attached to the page element. onmouseover means "when the mouse pointer moves over this". alert(1) means "show a small popup box with the number 1 in it". So together they say: when the pointer crosses this element, show a popup.
  • x=" at the end is tidying up. It opens a new quoted value so that the rest of the page's original markup still looks roughly valid and the browser does not choke on it.

Step 4: confirm the code actually ran

After he submitted the payload, an alert popup appeared every time the mouse cursor crossed the search field. That is the proof: the browser treated his typed text as an instruction rather than as plain text.

He classifies the bug as reflected XSS. Reflected means the payload is bounced straight back in the response to the same request, like a echo. The page does not save it anywhere; it only appears for the person who sent it. The other main type, stored XSS, is when the payload is saved on the server and shown to everyone who visits later. This one was reflected.

Photo by Fauzan Saari on Unsplash From the original on joshuaarulsamy.medium.com

Step 5: report it and wait

He reported the vulnerability by email to [redacted] on 19 January. He then waited almost two months. On 16 March his name, Joshua Arulsamy, was added to the Hall of Fame.

Finally, My Name was Added to the Infosec Hall of Fame From the original on joshuaarulsamy.medium.com

The report links to the public list at https://unite.un.org/content/hall-fame/list so readers can find the entry.

Why the bug existed

The report does not include the server-side code or the raw response, so the cause can only be inferred. The behaviour fits a simple pattern: the search term is written into an HTML attribute without encoding the double quote. Encoding means converting a character that has special meaning into a harmless stand-in, so that a double quote typed by a user is displayed as a quote rather than treated as the end of an attribute. Because that conversion was missing, the attacker could close the attribute and add a new event handler.

Because the payload is reflected per request, the page is building its markup from what the user typed rather than serving a fixed form. Why the site's existing defences did not stop it is not discussed.

What the impact could be

The report does not analyse impact beyond calling the finding a reflected XSS. In general terms, a reflected XSS on a United Nations subdomain would let an attacker build a link that runs script in the context of that site when a victim opens it. That script could act as the victim on that site, or present convincing content under the United Nations name. The report gives no details on what session data, cookies or functionality were reachable from the injection point, and it offers no proof beyond the alert(1) popup. Exploitation requires the victim to follow a crafted URL containing the payload.

A cookie, briefly, is a small piece of data a website asks your browser to keep and send back on every visit, which is how sites remember that you are logged in. If script can run on a site's page, it can often read or use those cookies, which is why XSS matters even when the popup itself looks harmless.

What the fix would be

It only records that the issue was reported and that the researcher was added to the Hall of Fame. A content security policy is a set of rules a site sends to the browser saying which scripts are allowed to run, so that even if a payload slips through, the browser refuses to execute it.

Things you could try next

These are generalisations from the technique, not things the report claims to have tried:

  1. Try the same attribute-breakout pattern on other reflected parameters, substituting the quote character that matches the context: x" onmouseover=alert(1) x=" for double-quoted attributes, and the single-quote equivalent for single-quoted ones. A positive result is the handler firing when the pointer crosses the injected element.
  2. Try event handlers that do not need pointer movement, such as onfocus with autofocus, since an onmouseover payload depends on the victim interacting with the field. A positive result is script running without any mouse movement.
  3. Try the payload against other legacy .asp pages found during directory brute forcing on the same host, since the same templating pattern is often reused. A positive result is the same reflection behaviour on a different endpoint.
  4. Enumerate further subdomains with a second tool and repeat the search-field test on each, following the researcher's advice to combine enumeration sources. A positive result is any subdomain where the payload is reflected unencoded.

Glossary

  • Hall of Fame: a public list an organisation keeps of people who have reported security problems to it.
  • Cross-site scripting (XSS): a bug where a website runs text supplied by a user as if it were code, in someone else's browser.
  • Reflected XSS: an XSS bug where the payload is echoed back in the response to the same request and is not saved on the server.
  • Stored XSS: an XSS bug where the payload is saved on the server and shown to later visitors.
  • Clickjacking: hiding one page under another so a visitor clicks something different from what they think they are clicking.
  • Subdomain: a smaller address under a main domain name, such as shop.example.com under example.com.
  • Subdomain enumeration: gathering as many subdomain names as possible for a domain, using tools or online services.
  • Directory brute forcing: asking a web server for many common folder and file names in turn to discover which exist.
  • Query string: the part of a web address that carries information to the page, usually after a question mark.
  • ASP: Active Server Pages, a Microsoft technology that builds a web page on the server each time it is requested.
  • Payload: the exact piece of text sent to an input to test how the site handles it.
  • HTML: the language web pages are written in, where text is wrapped in tags and quoted attributes.
  • Attribute: a setting inside an HTML tag, usually written as name="value".
  • Event handler: an instruction attached to a page element that runs when something happens, such as the mouse moving over it.
  • alert(1): a browser instruction that shows a small popup box containing the number 1, used as harmless proof that code ran.
  • Encoding: converting a character with special meaning into a harmless stand-in so it is displayed rather than interpreted.
  • Content security policy: rules a site sends to the browser saying which scripts are allowed to run.
  • Cookie: a small piece of data a site asks the browser to keep and send back on each visit, often used to stay logged in.
  • Black-box testing: testing a system from the outside without seeing its code or internal setup.
  • amass, subfinder, sublist3r: command-line tools that collect subdomain names.
  • DNSDumpster, VirusTotal: online services that can show subdomains for a domain.

More from United Nations

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.