From cc52273ef361474e2bb970d262d54a1f9d2f339a Mon Sep 17 00:00:00 2001 From: "J. King" Date: Fri, 17 Mar 2023 15:19:13 -0400 Subject: [PATCH] Import standard tests --- RoboFile.php | 1 + tests/cases/std-sanitize.json | 1733 +++++++++++++++++++++++++++++++++ tests/package.json | 6 + tests/parsetests | 136 +++ tests/yarn.lock | 399 ++++++++ 5 files changed, 2275 insertions(+) create mode 100644 tests/cases/std-sanitize.json create mode 100644 tests/package.json create mode 100755 tests/parsetests create mode 100644 tests/yarn.lock diff --git a/RoboFile.php b/RoboFile.php index 43fcaa6..345bda0 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -66,6 +66,7 @@ class RoboFile extends \Robo\Tasks { $c->addTask($this->taskGitStack()->cloneRepo($url, $dir)); } } + $c->addTask($this->taskExec(BASE_TEST."parsetests")->arg(BASE_TEST."platform-tests")->rawArg(">")->arg(BASE_TEST."cases".DIRECTORY_SEPARATOR."std-sanitize.json")); return $c->run(); } diff --git a/tests/cases/std-sanitize.json b/tests/cases/std-sanitize.json new file mode 100644 index 0000000..a0d4070 --- /dev/null +++ b/tests/cases/std-sanitize.json @@ -0,0 +1,1733 @@ +[ + { + "config": null, + "input": [], + "inputType": "literal", + "output": null, + "exceptionType": "TypeError", + "message": "Sanitizer.sanitize() should throw an error." + }, + { + "config": null, + "input": [ + null + ], + "inputType": "literal", + "output": null, + "exceptionType": "TypeError", + "message": "Sanitizer.sanitize(null)." + }, + { + "config": null, + "input": [ + "hello" + ], + "inputType": "document-fragment", + "output": "hello", + "message": "Sanitizer.sanitze(DocumentFragment)" + }, + { + "config": null, + "input": [ + "hello" + ], + "inputType": "document", + "output": "hello", + "message": "Sanitizer.sanitze(Document)" + }, + { + "config": {}, + "input": [ + "test" + ], + "inputType": "document", + "output": "test", + "message": "SanitizerAPI with config: string, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "bla" + ], + "inputType": "document", + "output": "bla", + "message": "SanitizerAPI with config: html fragment, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "" + }, + { + "config": {}, + "input": [ + "[object Object]" + ], + "inputType": "document", + "output": "[object Object]", + "message": "SanitizerAPI with config: empty object, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "1" + ], + "inputType": "document", + "output": "1", + "message": "SanitizerAPI with config: number, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "0" + ], + "inputType": "document", + "output": "0", + "message": "SanitizerAPI with config: zeros, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "3" + ], + "inputType": "document", + "output": "3", + "message": "SanitizerAPI with config: arithmetic, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "" + ], + "inputType": "document", + "output": "", + "message": "SanitizerAPI with config: empty string, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "undefined" + ], + "inputType": "document", + "output": "undefined", + "message": "SanitizerAPI with config: undefined, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "test" + ], + "inputType": "document", + "output": "test", + "message": "SanitizerAPI with config: document, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "
test" + ], + "inputType": "document", + "output": "
test
", + "message": "SanitizerAPI with config: html without close tag, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "" + ], + "inputType": "document", + "output": "", + "message": "SanitizerAPI with config: scripts for default configs, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "hello" + ], + "inputType": "document", + "output": "hello", + "message": "SanitizerAPI with config: script not as root, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "
hello" + ], + "inputType": "document", + "output": "
hello
", + "message": "SanitizerAPI with config: script deeper in the tree, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "

Click.

" + ], + "inputType": "document", + "output": "

Click.

", + "message": "SanitizerAPI with config: onclick scripts, sanitize from document function for " + }, + { + "config": {}, + "input": [ + "<p>text</p>" + ], + "inputType": "document", + "output": "&lt;p&gt;text&lt;/p&gt;", + "message": "SanitizerAPI with config: plaintext, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><xmp>TEXT</xmp>" + ], + "inputType": "document", + "output": "TEXT", + "message": "SanitizerAPI with config: xmp, sanitize from document function for <body>" + }, + { + "config": { + "test": 123 + }, + "input": [ + "<!DOCTYPE html><body>test" + ], + "inputType": "document", + "output": "test", + "message": "SanitizerAPI with config: invalid config_input, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [] + }, + "input": [ + "<!DOCTYPE html><body>test" + ], + "inputType": "document", + "output": "test", + "message": "SanitizerAPI with config: empty dropElements list, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "div" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>test</div><p>bla" + ], + "inputType": "document", + "output": "<p>bla</p>", + "message": "SanitizerAPI with config: test html without close tag with dropElements list ['div'], sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><custom-element>test</custom-element>bla" + ], + "inputType": "document", + "output": "bla", + "message": "SanitizerAPI with config: default behavior for custom elements, sanitize from document function for <body>" + }, + { + "config": { + "allowCustomElements": true + }, + "input": [ + "<!DOCTYPE html><body><custom-element>test</custom-element>bla" + ], + "inputType": "document", + "output": "testbla", + "message": "SanitizerAPI with config: allow custom elements, sanitize from document function for <body>" + }, + { + "config": { + "allowCustomElements": true, + "allowElements": [ + "custom-element" + ] + }, + "input": [ + "<!DOCTYPE html><body><custom-element>test</custom-element>bla" + ], + "inputType": "document", + "output": "<custom-element>test</custom-element>bla", + "message": "SanitizerAPI with config: allow custom elements with allow elements, sanitize from document function for <body>" + }, + { + "config": { + "allowCustomElements": false + }, + "input": [ + "<!DOCTYPE html><body><custom-element>test</custom-element>bla" + ], + "inputType": "document", + "output": "bla", + "message": "SanitizerAPI with config: disallow custom elements, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "custom-element" + ], + "allowCustomElements": true + }, + "input": [ + "<!DOCTYPE html><body><custom-element>test</custom-element>bla" + ], + "inputType": "document", + "output": "bla", + "message": "SanitizerAPI with config: allow custom elements with drop list contains [\"custom-element\"], sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "script" + ] + }, + "input": [ + "<!DOCTYPE html><body><script>alert('i am a test')</script>" + ], + "inputType": "document", + "output": "", + "message": "SanitizerAPI with config: test script with [\"script\"] as dropElements list, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "test-element", + "i" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<i>test</i></div><test-element>t</test-element>" + ], + "inputType": "document", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements list [\"test-element\", \"i\"]}, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "dl", + "p" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<i>i</i><p>t</p></div>" + ], + "inputType": "document", + "output": "<div>balabala<i>i</i></div>", + "message": "SanitizerAPI with config: dropElements list [\"dl\", \"p\"]}, sanitize from document function for <body>" + }, + { + "config": { + "allowElements": [ + "p" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>test<div>p</div>tt<p>div</p></div>" + ], + "inputType": "document", + "output": "testptt<p>div</p>", + "message": "SanitizerAPI with config: allowElements list [\"p\"], sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "div" + ], + "allowElements": [ + "div" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>test</div><p>bla" + ], + "inputType": "document", + "output": "bla", + "message": "SanitizerAPI with config: allowElements list has no influence to dropElements, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "style": [ + "p" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p style='color: black'>Click.</p><div style='color: white'>div</div>" + ], + "inputType": "document", + "output": "<p>Click.</p><div style=\"color: white\">div</div>", + "message": "SanitizerAPI with config: dropAttributes list {\"style\": [\"p\"]} with style attribute, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": {} + }, + "input": [ + "<!DOCTYPE html><body><p id='test'>Click.</p>" + ], + "inputType": "document", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: empty dropAttributes list with id attribute, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "id": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p id='test'>Click.</p>" + ], + "inputType": "document", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"id\": [\"*\"]} with id attribute, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "data-attribute-with-dashes": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p id='p' data-attribute-with-dashes='123'>Click.</p><script>document.getElementById('p').dataset.attributeWithDashes=123;</script>" + ], + "inputType": "document", + "output": "<p id=\"p\">Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"data-attribute-with-dashes\": [\"*\"]} with dom dataset js access, sanitize from document function for <body>" + }, + { + "config": { + "allowAttributes": { + "id": [ + "div" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p id='p'>P</p><div id='div'>DIV</div>" + ], + "inputType": "document", + "output": "<p>P</p><div id=\"div\">DIV</div>", + "message": "SanitizerAPI with config: allowAttributes list {\"id\": [\"div\"]} with id attribute, sanitize from document function for <body>" + }, + { + "config": { + "allowAttributes": { + "id": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p id='test' onclick='a= 123'>Click.</p>" + ], + "inputType": "document", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: allowAttributes list {\"id\": [\"*\"]} with id attribute and onclick scripts, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "style": [ + "*" + ] + }, + "allowAttributes": { + "style": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p style='color: black'>Click.</p>" + ], + "inputType": "document", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: allowAttributes list has no influence to dropAttributes, sanitize from document function for <body>" + }, + { + "config": { + "allowElements": [ + "template", + "div" + ] + }, + "input": [ + "<!DOCTYPE html><body><template><script>test</script><div>hello</div></template>" + ], + "inputType": "document", + "output": "<template><div>hello</div></template>", + "message": "SanitizerAPI with config: Template element, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><a href='javascript:evil.com'>Click.</a>" + ], + "inputType": "document", + "output": "<a>Click.</a>", + "message": "SanitizerAPI with config: HTMLAnchorElement with javascript protocal, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><a href=' javascript:evil.com'>Click.</a>" + ], + "inputType": "document", + "output": "<a>Click.</a>", + "message": "SanitizerAPI with config: HTMLAnchorElement with javascript protocal start with space, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><a href='http:evil.com'>Click.</a>" + ], + "inputType": "document", + "output": "<a href=\"http:evil.com\">Click.</a>", + "message": "SanitizerAPI with config: HTMLAnchorElement, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><area href='javascript:evil.com'>Click.</area>" + ], + "inputType": "document", + "output": "<area>Click.", + "message": "SanitizerAPI with config: HTMLAreaElement with javascript protocal, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><area href=' javascript:evil.com'>Click.</area>" + ], + "inputType": "document", + "output": "<area>Click.", + "message": "SanitizerAPI with config: HTMLAreaElement with javascript protocal start with space, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><area href='http:evil.com'>Click.</area>" + ], + "inputType": "document", + "output": "<area href=\"http:evil.com\">Click.", + "message": "SanitizerAPI with config: HTMLAreaElement, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><form action='javascript:evil.com'>Click.</form>" + ], + "inputType": "document", + "output": "<form>Click.</form>", + "message": "SanitizerAPI with config: HTMLFormElement with javascript action, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><form action=' javascript:evil.com'>Click.</form>" + ], + "inputType": "document", + "output": "<form>Click.</form>", + "message": "SanitizerAPI with config: HTMLFormElement with javascript action start with space, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><form action='http:evil.com'>Click.</form>" + ], + "inputType": "document", + "output": "<form action=\"http:evil.com\">Click.</form>", + "message": "SanitizerAPI with config: HTMLFormElement, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><input formaction='javascript:evil.com'>Click.</input>" + ], + "inputType": "document", + "output": "<input>Click.", + "message": "SanitizerAPI with config: HTMLInputElement with javascript formaction, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><input formaction=' javascript:evil.com'>Click.</input>" + ], + "inputType": "document", + "output": "<input>Click.", + "message": "SanitizerAPI with config: HTMLInputElement with javascript formaction start with space, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><input formaction='http:evil.com'>Click.</input>" + ], + "inputType": "document", + "output": "<input formaction=\"http:evil.com\">Click.", + "message": "SanitizerAPI with config: HTMLInputElement, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><button formaction='javascript:evil.com'>Click.</button>" + ], + "inputType": "document", + "output": "<button>Click.</button>", + "message": "SanitizerAPI with config: HTMLButtonElement with javascript formaction, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><button formaction=' javascript:evil.com'>Click.</button>" + ], + "inputType": "document", + "output": "<button>Click.</button>", + "message": "SanitizerAPI with config: HTMLButtonElement with javascript formaction start with space, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><button formaction='http:evil.com'>Click.</button>" + ], + "inputType": "document", + "output": "<button formaction=\"http:evil.com\">Click.</button>", + "message": "SanitizerAPI with config: HTMLButtonElement, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><p>Some text</p></body><!-- 1 --></html><!-- 2 --><p>Some more text</p>" + ], + "inputType": "document", + "output": "<p>Some text</p><p>Some more text</p>", + "message": "SanitizerAPI with config: malformed HTML, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>" + ], + "inputType": "document", + "output": "<p>Some text</p><p>Some more text</p>", + "message": "SanitizerAPI with config: HTML with comments; comments not allowed, sanitize from document function for <body>" + }, + { + "config": { + "allowComments": true + }, + "input": [ + "<!DOCTYPE html><body><p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>" + ], + "inputType": "document", + "output": "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + "message": "SanitizerAPI with config: HTML with comments; allowComments, sanitize from document function for <body>" + }, + { + "config": { + "allowComments": false + }, + "input": [ + "<!DOCTYPE html><body><p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>" + ], + "inputType": "document", + "output": "<p>Some text</p><p>Some more text</p>", + "message": "SanitizerAPI with config: HTML with comments; !allowComments, sanitize from document function for <body>" + }, + { + "config": {}, + "input": [ + "<!DOCTYPE html><body><p>comment<!-- hello -->in<!-- </p> -->text</p>" + ], + "inputType": "document", + "output": "<p>commentintext</p>", + "message": "SanitizerAPI with config: HTML with comments deeper in the tree, sanitize from document function for <body>" + }, + { + "config": { + "allowComments": true + }, + "input": [ + "<!DOCTYPE html><body><p>comment<!-- hello -->in<!-- </p> -->text</p>" + ], + "inputType": "document", + "output": "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + "message": "SanitizerAPI with config: HTML with comments deeper in the tree, allowComments, sanitize from document function for <body>" + }, + { + "config": { + "allowComments": false + }, + "input": [ + "<!DOCTYPE html><body><p>comment<!-- hello -->in<!-- </p> -->text</p>" + ], + "inputType": "document", + "output": "<p>commentintext</p>", + "message": "SanitizerAPI with config: HTML with comments deeper in the tree, !allowComments, sanitize from document function for <body>" + }, + { + "config": { + "allowElements": [ + "svg" + ] + }, + "input": [ + "<!DOCTYPE html><body><svg></svg>" + ], + "inputType": "document", + "output": "", + "message": "SanitizerAPI with config: Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces., sanitize from document function for <body>" + }, + { + "config": { + "allowElements": [ + "div", + "svg" + ] + }, + "input": [ + "<!DOCTYPE html><body><div><svg></svg></div>" + ], + "inputType": "document", + "output": "<div></div>", + "message": "SanitizerAPI with config: Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces when nested., sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "I", + "DL" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<dl>test</dl></div>" + ], + "inputType": "document", + "output": "<div>balabala<dl>test</dl></div>", + "message": "SanitizerAPI with config: dropElements list [\"I\", \"DL\"]}, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "i", + "dl" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<dl>test</dl></div>" + ], + "inputType": "document", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements list [\"i\", \"dl\"]}, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + "i", + "dl" + ] + }, + "input": [ + "<!DOCTYPE html><body><DIV>balabala<DL>test</DL></DIV>" + ], + "inputType": "document", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements list [\"i\", \"dl\"]} with uppercase HTML, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "ID": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p id=\"test\">Click.</p>" + ], + "inputType": "document", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"ID\": [\"*\"]} with id attribute, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "ID": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p ID=\"test\">Click.</p>" + ], + "inputType": "document", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"ID\": [\"*\"]} with ID attribute, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "id": [ + "*" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><p ID=\"test\">Click.</p>" + ], + "inputType": "document", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"id\": [\"*\"]} with ID attribute, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + 123, + "test", + "i", + "custom-element" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>" + ], + "inputType": "document", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements with unknown elements and without allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "blockElements": [ + 123, + "test", + "i", + "custom-element" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>" + ], + "inputType": "document", + "output": "<div>balabalatest</div>", + "message": "SanitizerAPI with config: blockElements with unknown elements and without allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "allowElements": [ + "p", + "test" + ] + }, + "input": [ + "<!DOCTYPE html><body><div>test<div>p</div>tt<p>div</p></div><test>test</test>" + ], + "inputType": "document", + "output": "testptt<p>div</p>", + "message": "SanitizerAPI with config: allowElements with unknown elements and without allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "dropElements": [ + 123, + "test", + "i", + "custom-element" + ], + "allowUnknownMarkup": true + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>" + ], + "inputType": "document", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements with unknown elements and with allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "blockElements": [ + 123, + "test", + "i", + "custom-element" + ], + "allowUnknownMarkup": true + }, + "input": [ + "<!DOCTYPE html><body><div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>" + ], + "inputType": "document", + "output": "<div>balabalatest</div>t", + "message": "SanitizerAPI with config: blockElements with unknown elements and with allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "allowElements": [ + "p", + "test" + ], + "allowUnknownMarkup": true + }, + "input": [ + "<!DOCTYPE html><body><div>test<div>p</div>tt<p>div</p><test>test</test></div>" + ], + "inputType": "document", + "output": "testptt<p>div</p><test>test</test>", + "message": "SanitizerAPI with config: allowElements with unknown elements and with allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "allowAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><div hello='1' world='2'><b hello='3' world='4'>" + ], + "inputType": "document", + "output": "<div><b></b></div>", + "message": "SanitizerAPI with config: allowAttributes unknown attributes and without allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "allowAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + }, + "allowUnknownMarkup": true + }, + "input": [ + "<!DOCTYPE html><body><div hello='1' world='2'><b hello='3' world='4'>" + ], + "inputType": "document", + "output": "<div hello=\"1\"><b hello=\"3\" world=\"4\"></b></div>", + "message": "SanitizerAPI with config: allowAttributes unknown attributes and with allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + } + }, + "input": [ + "<!DOCTYPE html><body><div hello='1' world='2'><b hello='3' world='4'>" + ], + "inputType": "document", + "output": "<div><b></b></div>", + "message": "SanitizerAPI with config: dropAttributes unknown attributes and without allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": { + "dropAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + }, + "allowUnknownMarkup": true + }, + "input": [ + "<!DOCTYPE html><body><div hello='1' world='2'><b hello='3' world='4'>" + ], + "inputType": "document", + "output": "<div><b></b></div>", + "message": "SanitizerAPI with config: dropAttributes unknown attributes and with allowUnknownMarkup, sanitize from document function for <body>" + }, + { + "config": {}, + "input": "test", + "inputType": "template-content", + "output": "test", + "message": "SanitizerAPI with config: string, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<b>bla</b>", + "inputType": "template-content", + "output": "<b>bla</b>", + "message": "SanitizerAPI with config: html fragment, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<a<embla", + "inputType": "template-content", + "output": "", + "message": "SanitizerAPI with config: broken html, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": {}, + "inputType": "template-content", + "output": "[object Object]", + "message": "SanitizerAPI with config: empty object, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": 1, + "inputType": "template-content", + "output": "1", + "message": "SanitizerAPI with config: number, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": 0, + "inputType": "template-content", + "output": "0", + "message": "SanitizerAPI with config: zeros, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": 3, + "inputType": "template-content", + "output": "3", + "message": "SanitizerAPI with config: arithmetic, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "", + "inputType": "template-content", + "output": "", + "message": "SanitizerAPI with config: empty string, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "inputType": "template-content", + "output": "undefined", + "message": "SanitizerAPI with config: undefined, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<html><head></head><body>test</body></html>", + "inputType": "template-content", + "output": "test", + "message": "SanitizerAPI with config: document, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<div>test", + "inputType": "template-content", + "output": "<div>test</div>", + "message": "SanitizerAPI with config: html without close tag, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<script>alert('i am a test')</script>", + "inputType": "template-content", + "output": "", + "message": "SanitizerAPI with config: scripts for default configs, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "hello<script>alert('i am a test')</script>", + "inputType": "template-content", + "output": "hello", + "message": "SanitizerAPI with config: script not as root, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<div><b>hello<script>alert('i am a test')</script>", + "inputType": "template-content", + "output": "<div><b>hello</b></div>", + "message": "SanitizerAPI with config: script deeper in the tree, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<p onclick='a= 123'>Click.</p>", + "inputType": "template-content", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: onclick scripts, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<plaintext><p>text</p>", + "inputType": "template-content", + "output": "&lt;p&gt;text&lt;/p&gt;", + "message": "SanitizerAPI with config: plaintext, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<xmp>TEXT</xmp>", + "inputType": "template-content", + "output": "TEXT", + "message": "SanitizerAPI with config: xmp, sanitize from document fragment function for <template>" + }, + { + "config": { + "test": 123 + }, + "input": "test", + "inputType": "template-content", + "output": "test", + "message": "SanitizerAPI with config: invalid config_input, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [] + }, + "input": "test", + "inputType": "template-content", + "output": "test", + "message": "SanitizerAPI with config: empty dropElements list, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "div" + ] + }, + "input": "<div>test</div><p>bla", + "inputType": "template-content", + "output": "<p>bla</p>", + "message": "SanitizerAPI with config: test html without close tag with dropElements list ['div'], sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<custom-element>test</custom-element>bla", + "inputType": "template-content", + "output": "bla", + "message": "SanitizerAPI with config: default behavior for custom elements, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowCustomElements": true + }, + "input": "<custom-element>test</custom-element>bla", + "inputType": "template-content", + "output": "testbla", + "message": "SanitizerAPI with config: allow custom elements, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowCustomElements": true, + "allowElements": [ + "custom-element" + ] + }, + "input": "<custom-element>test</custom-element>bla", + "inputType": "template-content", + "output": "<custom-element>test</custom-element>bla", + "message": "SanitizerAPI with config: allow custom elements with allow elements, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowCustomElements": false + }, + "input": "<custom-element>test</custom-element>bla", + "inputType": "template-content", + "output": "bla", + "message": "SanitizerAPI with config: disallow custom elements, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "custom-element" + ], + "allowCustomElements": true + }, + "input": "<custom-element>test</custom-element>bla", + "inputType": "template-content", + "output": "bla", + "message": "SanitizerAPI with config: allow custom elements with drop list contains [\"custom-element\"], sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "script" + ] + }, + "input": "<script>alert('i am a test')</script>", + "inputType": "template-content", + "output": "", + "message": "SanitizerAPI with config: test script with [\"script\"] as dropElements list, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "test-element", + "i" + ] + }, + "input": "<div>balabala<i>test</i></div><test-element>t</test-element>", + "inputType": "template-content", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements list [\"test-element\", \"i\"]}, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "dl", + "p" + ] + }, + "input": "<div>balabala<i>i</i><p>t</p></div>", + "inputType": "template-content", + "output": "<div>balabala<i>i</i></div>", + "message": "SanitizerAPI with config: dropElements list [\"dl\", \"p\"]}, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowElements": [ + "p" + ] + }, + "input": "<div>test<div>p</div>tt<p>div</p></div>", + "inputType": "template-content", + "output": "testptt<p>div</p>", + "message": "SanitizerAPI with config: allowElements list [\"p\"], sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "div" + ], + "allowElements": [ + "div" + ] + }, + "input": "<div>test</div><p>bla", + "inputType": "template-content", + "output": "bla", + "message": "SanitizerAPI with config: allowElements list has no influence to dropElements, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "style": [ + "p" + ] + } + }, + "input": "<p style='color: black'>Click.</p><div style='color: white'>div</div>", + "inputType": "template-content", + "output": "<p>Click.</p><div style=\"color: white\">div</div>", + "message": "SanitizerAPI with config: dropAttributes list {\"style\": [\"p\"]} with style attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": {} + }, + "input": "<p id='test'>Click.</p>", + "inputType": "template-content", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: empty dropAttributes list with id attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "id": [ + "*" + ] + } + }, + "input": "<p id='test'>Click.</p>", + "inputType": "template-content", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"id\": [\"*\"]} with id attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "data-attribute-with-dashes": [ + "*" + ] + } + }, + "input": "<p id='p' data-attribute-with-dashes='123'>Click.</p><script>document.getElementById('p').dataset.attributeWithDashes=123;</script>", + "inputType": "template-content", + "output": "<p id=\"p\">Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"data-attribute-with-dashes\": [\"*\"]} with dom dataset js access, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowAttributes": { + "id": [ + "div" + ] + } + }, + "input": "<p id='p'>P</p><div id='div'>DIV</div>", + "inputType": "template-content", + "output": "<p>P</p><div id=\"div\">DIV</div>", + "message": "SanitizerAPI with config: allowAttributes list {\"id\": [\"div\"]} with id attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowAttributes": { + "id": [ + "*" + ] + } + }, + "input": "<p id='test' onclick='a= 123'>Click.</p>", + "inputType": "template-content", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: allowAttributes list {\"id\": [\"*\"]} with id attribute and onclick scripts, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "style": [ + "*" + ] + }, + "allowAttributes": { + "style": [ + "*" + ] + } + }, + "input": "<p style='color: black'>Click.</p>", + "inputType": "template-content", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: allowAttributes list has no influence to dropAttributes, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowElements": [ + "template", + "div" + ] + }, + "input": "<template><script>test</script><div>hello</div></template>", + "inputType": "template-content", + "output": "<template><div>hello</div></template>", + "message": "SanitizerAPI with config: Template element, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<a href='javascript:evil.com'>Click.</a>", + "inputType": "template-content", + "output": "<a>Click.</a>", + "message": "SanitizerAPI with config: HTMLAnchorElement with javascript protocal, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<a href=' javascript:evil.com'>Click.</a>", + "inputType": "template-content", + "output": "<a>Click.</a>", + "message": "SanitizerAPI with config: HTMLAnchorElement with javascript protocal start with space, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<a href='http:evil.com'>Click.</a>", + "inputType": "template-content", + "output": "<a href=\"http:evil.com\">Click.</a>", + "message": "SanitizerAPI with config: HTMLAnchorElement, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<area href='javascript:evil.com'>Click.</area>", + "inputType": "template-content", + "output": "<area>Click.", + "message": "SanitizerAPI with config: HTMLAreaElement with javascript protocal, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<area href=' javascript:evil.com'>Click.</area>", + "inputType": "template-content", + "output": "<area>Click.", + "message": "SanitizerAPI with config: HTMLAreaElement with javascript protocal start with space, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<area href='http:evil.com'>Click.</area>", + "inputType": "template-content", + "output": "<area href=\"http:evil.com\">Click.", + "message": "SanitizerAPI with config: HTMLAreaElement, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<form action='javascript:evil.com'>Click.</form>", + "inputType": "template-content", + "output": "<form>Click.</form>", + "message": "SanitizerAPI with config: HTMLFormElement with javascript action, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<form action=' javascript:evil.com'>Click.</form>", + "inputType": "template-content", + "output": "<form>Click.</form>", + "message": "SanitizerAPI with config: HTMLFormElement with javascript action start with space, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<form action='http:evil.com'>Click.</form>", + "inputType": "template-content", + "output": "<form action=\"http:evil.com\">Click.</form>", + "message": "SanitizerAPI with config: HTMLFormElement, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<input formaction='javascript:evil.com'>Click.</input>", + "inputType": "template-content", + "output": "<input>Click.", + "message": "SanitizerAPI with config: HTMLInputElement with javascript formaction, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<input formaction=' javascript:evil.com'>Click.</input>", + "inputType": "template-content", + "output": "<input>Click.", + "message": "SanitizerAPI with config: HTMLInputElement with javascript formaction start with space, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<input formaction='http:evil.com'>Click.</input>", + "inputType": "template-content", + "output": "<input formaction=\"http:evil.com\">Click.", + "message": "SanitizerAPI with config: HTMLInputElement, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<button formaction='javascript:evil.com'>Click.</button>", + "inputType": "template-content", + "output": "<button>Click.</button>", + "message": "SanitizerAPI with config: HTMLButtonElement with javascript formaction, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<button formaction=' javascript:evil.com'>Click.</button>", + "inputType": "template-content", + "output": "<button>Click.</button>", + "message": "SanitizerAPI with config: HTMLButtonElement with javascript formaction start with space, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<button formaction='http:evil.com'>Click.</button>", + "inputType": "template-content", + "output": "<button formaction=\"http:evil.com\">Click.</button>", + "message": "SanitizerAPI with config: HTMLButtonElement, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<p>Some text</p></body><!-- 1 --></html><!-- 2 --><p>Some more text</p>", + "inputType": "template-content", + "output": "<p>Some text</p><p>Some more text</p>", + "message": "SanitizerAPI with config: malformed HTML, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + "inputType": "template-content", + "output": "<p>Some text</p><p>Some more text</p>", + "message": "SanitizerAPI with config: HTML with comments; comments not allowed, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowComments": true + }, + "input": "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + "inputType": "template-content", + "output": "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + "message": "SanitizerAPI with config: HTML with comments; allowComments, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowComments": false + }, + "input": "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + "inputType": "template-content", + "output": "<p>Some text</p><p>Some more text</p>", + "message": "SanitizerAPI with config: HTML with comments; !allowComments, sanitize from document fragment function for <template>" + }, + { + "config": {}, + "input": "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + "inputType": "template-content", + "output": "<p>commentintext</p>", + "message": "SanitizerAPI with config: HTML with comments deeper in the tree, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowComments": true + }, + "input": "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + "inputType": "template-content", + "output": "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + "message": "SanitizerAPI with config: HTML with comments deeper in the tree, allowComments, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowComments": false + }, + "input": "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + "inputType": "template-content", + "output": "<p>commentintext</p>", + "message": "SanitizerAPI with config: HTML with comments deeper in the tree, !allowComments, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowElements": [ + "svg" + ] + }, + "input": "<svg></svg>", + "inputType": "template-content", + "output": "", + "message": "SanitizerAPI with config: Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces., sanitize from document fragment function for <template>" + }, + { + "config": { + "allowElements": [ + "div", + "svg" + ] + }, + "input": "<div><svg></svg></div>", + "inputType": "template-content", + "output": "<div></div>", + "message": "SanitizerAPI with config: Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces when nested., sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "I", + "DL" + ] + }, + "input": "<div>balabala<dl>test</dl></div>", + "inputType": "template-content", + "output": "<div>balabala<dl>test</dl></div>", + "message": "SanitizerAPI with config: dropElements list [\"I\", \"DL\"]}, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "i", + "dl" + ] + }, + "input": "<div>balabala<dl>test</dl></div>", + "inputType": "template-content", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements list [\"i\", \"dl\"]}, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + "i", + "dl" + ] + }, + "input": "<DIV>balabala<DL>test</DL></DIV>", + "inputType": "template-content", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements list [\"i\", \"dl\"]} with uppercase HTML, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "ID": [ + "*" + ] + } + }, + "input": "<p id=\"test\">Click.</p>", + "inputType": "template-content", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"ID\": [\"*\"]} with id attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "ID": [ + "*" + ] + } + }, + "input": "<p ID=\"test\">Click.</p>", + "inputType": "template-content", + "output": "<p id=\"test\">Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"ID\": [\"*\"]} with ID attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "id": [ + "*" + ] + } + }, + "input": "<p ID=\"test\">Click.</p>", + "inputType": "template-content", + "output": "<p>Click.</p>", + "message": "SanitizerAPI with config: dropAttributes list {\"id\": [\"*\"]} with ID attribute, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + 123, + "test", + "i", + "custom-element" + ] + }, + "input": "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + "inputType": "template-content", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements with unknown elements and without allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "blockElements": [ + 123, + "test", + "i", + "custom-element" + ] + }, + "input": "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + "inputType": "template-content", + "output": "<div>balabalatest</div>", + "message": "SanitizerAPI with config: blockElements with unknown elements and without allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowElements": [ + "p", + "test" + ] + }, + "input": "<div>test<div>p</div>tt<p>div</p></div><test>test</test>", + "inputType": "template-content", + "output": "testptt<p>div</p>", + "message": "SanitizerAPI with config: allowElements with unknown elements and without allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropElements": [ + 123, + "test", + "i", + "custom-element" + ], + "allowUnknownMarkup": true + }, + "input": "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + "inputType": "template-content", + "output": "<div>balabala</div>", + "message": "SanitizerAPI with config: dropElements with unknown elements and with allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "blockElements": [ + 123, + "test", + "i", + "custom-element" + ], + "allowUnknownMarkup": true + }, + "input": "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + "inputType": "template-content", + "output": "<div>balabalatest</div>t", + "message": "SanitizerAPI with config: blockElements with unknown elements and with allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowElements": [ + "p", + "test" + ], + "allowUnknownMarkup": true + }, + "input": "<div>test<div>p</div>tt<p>div</p><test>test</test></div>", + "inputType": "template-content", + "output": "testptt<p>div</p><test>test</test>", + "message": "SanitizerAPI with config: allowElements with unknown elements and with allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + } + }, + "input": "<div hello='1' world='2'><b hello='3' world='4'>", + "inputType": "template-content", + "output": "<div><b></b></div>", + "message": "SanitizerAPI with config: allowAttributes unknown attributes and without allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "allowAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + }, + "allowUnknownMarkup": true + }, + "input": "<div hello='1' world='2'><b hello='3' world='4'>", + "inputType": "template-content", + "output": "<div hello=\"1\"><b hello=\"3\" world=\"4\"></b></div>", + "message": "SanitizerAPI with config: allowAttributes unknown attributes and with allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + } + }, + "input": "<div hello='1' world='2'><b hello='3' world='4'>", + "inputType": "template-content", + "output": "<div><b></b></div>", + "message": "SanitizerAPI with config: dropAttributes unknown attributes and without allowUnknownMarkup, sanitize from document fragment function for <template>" + }, + { + "config": { + "dropAttributes": { + "hello": [ + "*" + ], + "world": [ + "b" + ] + }, + "allowUnknownMarkup": true + }, + "input": "<div hello='1' world='2'><b hello='3' world='4'>", + "inputType": "template-content", + "output": "<div><b></b></div>", + "message": "SanitizerAPI with config: dropAttributes unknown attributes and with allowUnknownMarkup, sanitize from document fragment function for <template>" + } +] diff --git a/tests/package.json b/tests/package.json new file mode 100644 index 0000000..c517990 --- /dev/null +++ b/tests/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "jsdom": "^21.1.1", + "parse5": "^7.1.2" + } +} diff --git a/tests/parsetests b/tests/parsetests new file mode 100755 index 0000000..a90bb6a --- /dev/null +++ b/tests/parsetests @@ -0,0 +1,136 @@ +#! /usr/bin/node + +/* +Parses the sanitize() tests for the Sanitizer API into JSON for easier + consumption by non-JavaScript environments. +*/ + +if (!process.argv[2]) { + console.log("Usage: parsetests <path-to-wpt-base>"); + return 2; +} + +const fs = require("fs"); +const JSDOM = require("jsdom").JSDOM; + +// resolve the path to the tests +var base = fs.realpathSync(process.argv[2]); + +// first read in the static test data +var testprog = fs.readFileSync(base + "/sanitizer-api/support/testcases.sub.js").toString() + "\n\n"; + +// next extract the tests proper from the containing HTML file +var testfile = fs.readFileSync(base + "/sanitizer-api/sanitizer-sanitize.https.tentative.html").toString(); +testprog += (new JSDOM(testfile)).window.document.body.getElementsByTagName("script")[0].textContent; + +// now define a minimal test harness which will produce plain JSON test data +var window = (new JSDOM("", {runScripts: "outside-only"})).window; +window.genericTestSet = []; +window.FakeTemplate = class { + innerHTML = ""; + get content() { + return this; + } +}; +window.origDOMParser = window.DOMParser; +window.DOMParser = function() { + return { + parseFromString: function(data, type) { + if (window.genericTest.input === undefined) { + window.genericTest.input = [data]; + } + return (new window.origDOMParser).parseFromString(data, type); + } + }; +}; +window.document.origCreateElement = window.document.createElement; +window.document.createElement = function(type) { + if (type === "template") { + return new window.FakeTemplate(); + } + return window.document.origCreateElement(type); +}; +window.test = function(prog, message) { + // override the getFragment() and getDoc() functions to extract the input, if they haven't been overidden already + if (!window.origGetFragment) { + window.origGetFragment = window.getFragment; + window.getFragment = function(i) { + if (window.genericTest.input === undefined) { + window.genericTest.input = [i]; + } else if (window.genericTest.input && window.genericTest.output === undefined) { + window.genericTest.output = i; + } + return window.origGetFragment(i); + } + } + if (!window.origGetDoc) { + window.origGetDoc = window.getDoc; + window.getDoc = function(i) { + if (window.genericTest.input === undefined) { + window.genericTest.input = [i]; + } + return window.origGetDoc(i); + } + } + window.genericTest = { + config: undefined, + input: undefined, + inputType: undefined, + output: undefined, + exceptionType: undefined, + message: message, + }; + prog(); + window.genericTestSet.push(window.genericTest); +}; +window.Sanitizer = function(conf) { + if (conf) { + if (Array.isArray(conf.dropAttributes)) { + var o = {}; + conf.dropAttributes.forEach(function(v) { + + o[v.name] = (v.elements === "*") ? ["*"] : v.elements; + }); + conf.dropAttributes = o; + } + if (Array.isArray(conf.allowAttributes)) { + var o = {}; + conf.allowAttributes.forEach(function(v) { + o[v.name] = (v.elements === "*") ? ["*"] : v.elements; + }); + conf.allowAttributes = o; + } + } + window.genericTest.config = conf || null; + return { + sanitize: function(dom) { + if (dom instanceof window.DocumentFragment) { + window.genericTest.inputType = "document-fragment"; + } else if (dom instanceof window.Document) { + window.genericTest.inputType = "document"; + } else if (dom instanceof window.FakeTemplate) { + window.genericTest.inputType = "template-content"; + window.genericTest.input = dom.innerHTML; + } else { + window.genericTest.inputType = "literal"; + if (window.genericTest.input === undefined) { + window.genericTest.input = Array.from(arguments); + } + } + return window.document.createDocumentFragment(); + } + }; +}; +window.assert_throws_js = function(t, f) { + window.genericTest.exceptionType = t.prototype.toString(); + window.genericTest.output = null; + f(); +}; +window.assert_true = function() {}; +window.assert_equals = function(result, exp) { + window.genericTest.output = exp; +}; + +// Finally execute the tests to produce our output +window.eval(testprog); +console.log(JSON.stringify(window.genericTestSet, null, 2)); \ No newline at end of file diff --git a/tests/yarn.lock b/tests/yarn.lock new file mode 100644 index 0000000..81893d5 --- /dev/null +++ b/tests/yarn.lock @@ -0,0 +1,399 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + +abab@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== + +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== + dependencies: + acorn "^8.1.0" + acorn-walk "^8.0.2" + +acorn-walk@^8.0.2: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.1.0, acorn@^8.8.2: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +cssstyle@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-3.0.0.tgz#17ca9c87d26eac764bb8cfd00583cff21ce0277a" + integrity sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg== + dependencies: + rrweb-cssom "^0.6.0" + +data-urls@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-4.0.0.tgz#333a454eca6f9a5b7b0f1013ff89074c3f522dd4" + integrity sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g== + dependencies: + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^12.0.0" + +debug@4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decimal.js@^10.4.3: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + +deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +domexception@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== + dependencies: + webidl-conversions "^7.0.0" + +entities@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" + integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== + +escodegen@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" + integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== + dependencies: + esprima "^4.0.1" + estraverse "^5.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +html-encoding-sniffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" + integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== + dependencies: + whatwg-encoding "^2.0.0" + +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== + +jsdom@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-21.1.1.tgz#ab796361e3f6c01bcfaeda1fea3c06197ac9d8ae" + integrity sha512-Jjgdmw48RKcdAIQyUD1UdBh2ecH7VqwaXPN3ehoZN6MqgVbMn+lRm1aAT1AsdJRAJpwfa4IpwgzySn61h2qu3w== + dependencies: + abab "^2.0.6" + acorn "^8.8.2" + acorn-globals "^7.0.0" + cssstyle "^3.0.0" + data-urls "^4.0.0" + decimal.js "^10.4.3" + domexception "^4.0.0" + escodegen "^2.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.2" + rrweb-cssom "^0.6.0" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^12.0.1" + ws "^8.13.0" + xml-name-validator "^4.0.0" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nwsapi@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" + integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== + +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +parse5@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + +psl@^1.1.33: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +punycode@^2.1.1, punycode@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + +rrweb-cssom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" + integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== + +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + +tough-cookie@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" + integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + +tr46@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469" + integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw== + dependencies: + punycode "^2.3.0" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +w3c-xmlserializer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== + dependencies: + xml-name-validator "^4.0.0" + +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + +whatwg-encoding@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" + integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== + dependencies: + iconv-lite "0.6.3" + +whatwg-mimetype@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== + +whatwg-url@^12.0.0, whatwg-url@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-12.0.1.tgz#fd7bcc71192e7c3a2a97b9a8d6b094853ed8773c" + integrity sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ== + dependencies: + tr46 "^4.1.1" + webidl-conversions "^7.0.0" + +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +ws@^8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + +xml-name-validator@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== + +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==