Skip to content

Commit

Permalink
Merge pull request #1650 from hackmdio/bugfix/fix-reveal-markdown-sto…
Browse files Browse the repository at this point in the history
…red-xss

Fix slide mode stored XSS
  • Loading branch information
Yukaii authored Jan 25, 2021
2 parents 5b4c7ef + c47f0f0 commit 452f9ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/reveal-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import { md } from './extra'

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

return '<script type="text/template">' + content + '</script>'
}
Expand Down
2 changes: 2 additions & 0 deletions public/js/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ const defaultOptions = {
}

var options = meta.slideOptions || {}
// delete dependencies to avoid import user defined external resources
delete options.dependencies

if (Object.hasOwnProperty.call(options, 'spotlight')) {
defaultOptions.dependencies.push({
Expand Down

0 comments on commit 452f9ac

Please sign in to comment.