Skip to content

Commit

Permalink
Fix: addressed a bypass on jsdom 22 when noframes tag is allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
cure53 committed Jun 29, 2023
1 parent 5e24d1f commit 786c809
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions dist/purify.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.cjs.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/purify.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.es.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1056,10 +1056,12 @@ function createDOMPurify(window = getGlobal()) {
return true;
}

/* Make sure that older browsers don't get noscript mXSS */
/* Make sure that older browsers don't get fallback-tag mXSS */
if (
(tagName === 'noscript' || tagName === 'noembed') &&
regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)
(tagName === 'noscript' ||
tagName === 'noembed' ||
tagName === 'noframes') &&
regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)
) {
_forceRemove(currentNode);
return true;
Expand Down

0 comments on commit 786c809

Please sign in to comment.