You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we've encountered a potential security issue related to XSS (Cross-Site Scripting) when using the data-background-video attribute in slides. It appears that the way Reveal.js handles this attribute might allow for the execution of injected scripts, even when the attribute value is HTML entity-encoded.
Consider the following example where we use an encoded string in the data-background-video attribute:
Hi @hakimel
Thanks for all your hard work!
we've encountered a potential security issue related to XSS (Cross-Site Scripting) when using the
data-background-video
attribute in slides. It appears that the way Reveal.js handles this attribute might allow for the execution of injected scripts, even when the attribute value is HTML entity-encoded.Consider the following example where we use an encoded string in the
data-background-video
attribute:The script will be executed despite being encoded. because
getAttribute
will decode entities even if they are already escaped:reveal.js/js/controllers/slidecontent.js
Line 102 in c239642
And then concat in
innerHTML
will cause XSS:reveal.js/js/controllers/slidecontent.js
Lines 144 to 152 in c239642
Fix is pretty easy I think. Just replace
innerHTML
with attribute assignment, as shown below:Using
setAttribute
ensures that the source remains a plain string.If this approach seems suitable, I would be happy to create a PR to address this. Thank you for your consideration!
The text was updated successfully, but these errors were encountered: