Skip to content

Commit

Permalink
Merge pull request #825 from cure53/main
Browse files Browse the repository at this point in the history
Merge main into 3.x
  • Loading branch information
cure53 authored Jun 29, 2023
2 parents c70f8c5 + 0ba23f9 commit 278dc8b
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.

It's also very simple to use and get started with. DOMPurify was [started in February 2014](https://github.com/cure53/DOMPurify/commit/a630922616927373485e0e787ab19e73e3691b2b) and, meanwhile, has reached version **v3.0.3**.
It's also very simple to use and get started with. DOMPurify was [started in February 2014](https://github.com/cure53/DOMPurify/commit/a630922616927373485e0e787ab19e73e3691b2b) and, meanwhile, has reached version **v3.0.4**.

DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Edge, Firefox and Chrome - as well as almost anything else using Blink, Gecko or WebKit). It doesn't break on MSIE or other legacy browsers. It simply does nothing.

**Note that [DOMPurify v2.4.5](https://github.com/cure53/DOMPurify/releases/tag/2.4.4) is the final version supporting MSIE. For important security updates compatible with MSIE, please use the [2.x branch](https://github.com/cure53/DOMPurify/tree/2.x).**
**Note that [DOMPurify v2.4.6](https://github.com/cure53/DOMPurify/releases/tag/2.4.6) is the latest version supporting MSIE. For important security updates compatible with MSIE, please use the [2.x branch](https://github.com/cure53/DOMPurify/tree/2.x).**

Our automated tests cover [19 different browsers](https://github.com/cure53/DOMPurify/blob/main/test/karma.custom-launchers.config.js#L5) right now, more to come. We also cover Node.js v16.x, v17.x, v18.x and v19.x, running DOMPurify on [jsdom](https://github.com/jsdom/jsdom). Older Node versions are known to work as well, but hey... no guarantees.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DOMPurify",
"version": "3.0.3",
"version": "3.0.4",
"homepage": "https://github.com/cure53/DOMPurify",
"author": "Cure53 <info@cure53.de>",
"description": "A DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG",
Expand Down
10 changes: 5 additions & 5 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.

10 changes: 5 additions & 5 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.

10 changes: 5 additions & 5 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.

4 changes: 2 additions & 2 deletions 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.

12 changes: 6 additions & 6 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
},
"name": "dompurify",
"description": "DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It's written in JavaScript and works in all modern browsers (Safari, Opera (15+), Internet Explorer (10+), Firefox and Chrome - as well as almost anything else using Blink or WebKit). DOMPurify is written by security people who have vast background in web attacks and XSS. Fear not.",
"version": "3.0.3",
"version": "3.0.4",
"directories": {
"test": "test"
},
Expand Down
10 changes: 6 additions & 4 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 Expand Up @@ -1499,7 +1501,7 @@ function createDOMPurify(window = getGlobal()) {
returnNode = body;
}

if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
/*
AdoptNode() is not used because internal state is not reset
(e.g. the past names map of a HTMLFormElement), this is safe
Expand Down
8 changes: 4 additions & 4 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<html>
<head>
<meta charset="UTF-8">
<title>DOMPurify 3.0.3 "Trust Broker"</title>
<title>DOMPurify 3.0.4 "Trust Manager"</title>
<script src="../dist/purify.min.js"></script>
<!-- we don't actually need it - just to demo and test the $(html) sanitation -->
<script src="//code.jquery.com/jquery-3.2.0.min.js"></script>
<script>
if(typeof console === 'undefined') {console={}; console.log=function(){}}
window.onload = function(){
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cdn.rawgit.com/cure53/DOMPurify/main/test/fixtures/expect.js');
xhr.open('GET', 'https://cdn.rawgit.com/cure53/DOMPurify/main/test/fixtures/expect.mjs');
xhr.onload = function(){
var data=JSON.parse(xhr.responseText.slice(17, -2));
var data=JSON.parse(xhr.responseText.slice(15, -2));
x.value = '<!-- I am ready now, click one of the buttons! -->\r\n';
for(var i in data) {
x.value+=data[i].payload+"\r\n\r\n";
Expand All @@ -23,7 +23,7 @@
</script>
</head>
<body>
<h4>DOMPurify 3.0.3 "Trust Broker"</h4>
<h4>DOMPurify 3.0.4 "Trust Manager"</h4>
<p>
<a href="http://badge.fury.io/js/dompurify" rel="nofollow"><img alt="npm version" src="https://badge.fury.io/js/dompurify.svg"></a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/cure53/DOMPurify/workflows/Build%20and%20Test/badge.svg?branch=main"><img src="https://github.com/cure53/DOMPurify/workflows/Build%20and%20Test/badge.svg?branch=main" alt="Build and Test"></a>
Expand Down

0 comments on commit 278dc8b

Please sign in to comment.