Skip to content
XSS Disclosed report Intermediate

DOM XSS on http://talks.lystit.com

A DOM-based cross-site scripting vulnerability existed on a presentation site because a postMessage handler parsed incoming messages and inserted the notes field into the page without sanitisation. An attacker could send a crafted message to execute arbitrary JavaScript in the context of the vulnerable page.

gamer7112 Follow

Originally disclosed on HackerOne

Bounty$100 Low View original
  • Triaged in 2 hours
  • Fixed in 22 days
  • Paid in 22 days
  • Disclosed after 3 months

#Description DOM XSS can be achieved via a postMessage due to an insecure postMessage handler being registered.

#POC

  1. Visit https://gamer7112.com/lyst_1.html
  2. Click the link
  3. View alert

#Vulnerable Code Located at http://talks.lystit.com/data-saloon-presentation/plugin/notes/notes.html

JavaScript
window.addEventListener('message', function(event) {
    var data = JSON.parse(event.data);

    // No need for updating the notes in case of fragment changes
    if (data.notes !== undefined) {
        if (data.markdown) {
            notes.innerHTML = marked(data.notes);
        } else {
            notes.innerHTML = data.notes;
        }
    }

    silenced = true;

    // Update the note slides
    currentSlide.contentWindow.Reveal.slide(data.indexh, data.indexv, data.indexf);
    nextSlide.contentWindow.Reveal.slide(data.nextindexh, data.nextindexv);

    silenced = false;

}, false);

Impact

XSS allows for an attacker to execute arbitrary javascript on another user.

The original report as published on HackerOne, by gamer7112. 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

The postMessage event handler did not validate the message origin and assigned untrusted message data directly to innerHTML without sanitisation.

Impact

An attacker could execute arbitrary JavaScript in another user's browser in the context of the vulnerable site.

What the attacker needed

Victim visits attacker page; victim clicks a link

The fix

The handler should verify the message origin and avoid assigning untrusted data to innerHTML.

How it was found

  1. Visit the attacker-controlled page that sends a postMessage to the vulnerable presentation page.
  2. Click the link on that page to trigger the message.
  3. Observe the JavaScript alert executing in the context of the vulnerable site.

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.

When one part of a website sends a message to another part (like a pop-up talking to its parent), the receiving code must check who sent it and treat the content as untrusted. Here, the page took whatever was in the message and put it directly into the page as HTML, so a malicious sender could inject a script. That script would then run as if it came from the trusted site.

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 gamer7112

View all

9 more disclosed reports, best first.

More from Lyst

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.