Skip to content
XSS Disclosed report Beginner

DOM Based XSS in Discourse Search

A DOM-based cross-site scripting flaw existed in Discourse's search feature. An attacker could craft a search URL containing a script payload that executed when a victim opened the link and used advanced search.

khizer47 Follow

Originally disclosed on HackerOne

  • Fixed in 39 hours
  • Paid in 24 days
  • Disclosed after 24 days

###Steps to Reproduce:

  1. Load http://try.discourse.org

2.Now From Top Right Corner Click on Search Button 3. Enter payload their

###Payload:

@<script>prompt(1337)</script>gmail.com

4: Now in new windows that opens click on advance search and The XSS will Occur :) 5: Now copy the link and send to victim there the XSS will Occur To

Thanks Khizer Javed

The original report as published on HackerOne, by khizer47. 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 page inserted the user-supplied query into the DOM without properly encoding it, allowing script execution.

Impact

An attacker could run script in a victim's browser on the Discourse site via a crafted search link.

What the attacker needed

Victim clicks a crafted link; victim uses advanced search

How it was found

  1. Open the Discourse test site.
  2. Click the search button in the top right corner.
  3. Enter the script payload into the search field.
  4. In the new window, click advanced search to trigger the XSS.
  5. Copy the resulting link and send it to a victim, where the XSS also occurs.

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.

Cross-site scripting (XSS) is when a website displays user input as code instead of plain text, so a script runs in the visitor's browser. Here, the search box accepted a script-like string and later ran it when the advanced search page loaded. An attacker could send a prepared link to someone and the script would run in their 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 khizer47

View all

13 more disclosed reports, best first.

More from Discourse

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.