Skip to content

Commit 0c2edea

Browse files
committed
fix: addressed an mXSS problem caused by nested headlines
1 parent 2c0017c commit 0c2edea

9 files changed

Lines changed: 10 additions & 9 deletions

File tree

dist/purify.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/purify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,8 @@ function createDOMPurify(window = getGlobal()) {
651651
/* Take care of an mXSS pattern using p, br inside svg, math */
652652
if (
653653
(tagName === 'svg' || tagName === 'math') &&
654-
currentNode.querySelectorAll('p, br, form, table').length !== 0
654+
currentNode.querySelectorAll('p, br, form, table, h1, h2, h3, h4, h5, h6')
655+
.length !== 0
655656
) {
656657
_forceRemove(currentNode);
657658
return true;

0 commit comments

Comments
 (0)