Skip to content

Commit 452f9ac

Browse files
authored
Merge pull request #1650 from hackmdio/bugfix/fix-reveal-markdown-stored-xss
Fix slide mode stored XSS
2 parents 5b4c7ef + c47f0f0 commit 452f9ac

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

public/js/reveal-markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ import { md } from './extra'
103103

104104
// prevent script end tags in the content from interfering
105105
// with parsing
106-
content = content.replace(/<\/script>/g, SCRIPT_END_PLACEHOLDER)
106+
content = content.replace(/<\/script>/gi, SCRIPT_END_PLACEHOLDER)
107107

108108
return '<script type="text/template">' + content + '</script>'
109109
}

public/js/slide.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ const defaultOptions = {
8080
}
8181

8282
var options = meta.slideOptions || {}
83+
// delete dependencies to avoid import user defined external resources
84+
delete options.dependencies
8385

8486
if (Object.hasOwnProperty.call(options, 'spotlight')) {
8587
defaultOptions.dependencies.push({

0 commit comments

Comments
 (0)