Skip to content
XSS Disclosed report Beginner

[█████] — DOM-based XSS on endpoint `/?s=`

The search parameter on the site's search endpoint is read by client-side JavaScript and inserted into the page without sanitisation, so a crafted link runs script in the visitor's browser. An attacker could use this to steal anti-CSRF tokens and take over an authenticated user's account.

usamasood Follow

Originally disclosed on HackerOne

  • Triaged in 19 hours
  • Fixed in 3 days
  • Disclosed after 57 days

Description

GET parameter s is vulnerable to DOM-based XSS on endpoint /?s=. XSS affects all users and no authentication or login is required.

Proof of Concept

Visit the following URL for PoC:

https://██████/?s=%27%3E%3Cscript%3Ealert(document.domain)%3C/script%3E

█████████

Explanation

This DOM-based XSS vulnerability is due to lack of sanitization on the input fetched via search input field.

Responsible JS file for this issue is: https://██████/wp-content/themes/iase/js/search.js

On line 12, var $search = ... is getting input from the Search field but there is no sanitization for single quote which leads to this XSS vulnerability when it is appended.

█████

Impact

An attacker can take over an account of an authenticated user by stealing any anti-CSRF tokens and using that token to takeover an account.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the search.js script reads the search input and appends it to the page without sanitising or encoding it, so a single quote breaks out of the surrounding context.

Impact

An attacker could steal anti-CSRF tokens from an authenticated user and use them to take over that account.

What the attacker needed

Victim opens a crafted link; no login needed to trigger

How it was found

  1. Open the search endpoint with the crafted search parameter in the URL.
  2. The page's search.js reads the parameter value and inserts it into the page.
  3. The injected script executes in the browser and shows the domain in an alert.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A web page can build its content in the browser using JavaScript. Here the search box value is placed into the page without cleaning it first, so text that looks like code gets run as code. That lets an attacker who sends a link run their own script in the victim's browser.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by usamasood

View all

2 more disclosed reports, best first.

More from U.S. Dept Of Defense

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.