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.
- 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
- Visit https://gamer7112.com/lyst_1.html
- Click the link
- View alert
#Vulnerable Code Located at http://talks.lystit.com/data-saloon-presentation/plugin/notes/notes.html
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.
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
- Visit the attacker-controlled page that sends a postMessage to the vulnerable presentation page.
- Click the link on that page to trigger the message.
- 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.