Skip to content

Commit

Permalink
fix: attemtping to fix another mutation behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
cure53 committed Sep 20, 2020
1 parent 63061bf commit 02724b8
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ function createDOMPurify(window = getGlobal()) {
/* Take care of an mXSS pattern using p, br inside svg, math */
if (
(tagName === 'svg' || tagName === 'math') &&
currentNode.querySelectorAll('p, br, form').length !== 0
currentNode.querySelectorAll('p, br, form, table').length !== 0
) {
_forceRemove(currentNode);
return true;
Expand Down
8 changes: 7 additions & 1 deletion test/fixtures/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,11 +1075,17 @@ module.exports = [
"<svg></svg><b><style><b title='</style><img>'&gt;</b>"
]
}, {
"title": "Tests against nesting-based mXSS behavior 1/1",
"title": "Tests against nesting-based mXSS behavior 1/2",
"payload": "<form><math><mtext></form><form><mglyph><style><img>",
"expected": [
"<form></form>"
]
}, {
"title": "Tests against nesting-based mXSS behavior 2/2",
"payload": "<math><mtext><table><mglyph><style><math>CLICKME</math>",
"expected": [
""
]
}, {
"title": "Tests against proper handling of leading whitespaces",
"payload": " ",
Expand Down

0 comments on commit 02724b8

Please sign in to comment.