Skip to content
XSS Disclosed report Intermediate CVE-2022-0776

Cross site scripting in reveal.js

The speaker-view plugin of reveal.js accepts postMessage events without checking the sender's origin, then inserts the message content into the page. An attacker could send a crafted message from any origin to execute arbitrary JavaScript in the victim's browser window that hosts reveal.js.

hakimel/reveal.js

Originally disclosed on huntr

The onmessage event listener in /plugin/notes/speaker-view.html does not check the origin of postMessage before adding the content to the webpage. The vulnerable code allows any origin to postMessage on the browser window and feeds attacker's input to parts using which attacker can execute arbitrary javascript code on victim's browser window hosting reveal.js

From the GitHub Advisory Database (GHSA-hhqj-cfjx-vj25, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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 onmessage event listener in the speaker-view plugin did not validate the origin of incoming postMessage events before using the message data in the page.

Impact

An attacker could execute arbitrary JavaScript in the victim's browser window that hosts reveal.js, but the text does not state whether any defence limited the attack.

What the attacker needed

Victim hosts reveal.js with speaker-view plugin; attacker can send a postMessage to that window

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 a web page opens another window, the two can send messages to each other using a browser feature called postMessage. The receiving page is supposed to check who sent the message, but this plugin did not. That meant any website could send a message that the plugin would treat as trusted and use to run harmful code 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.

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.