dompurify 2.5.5 → 2.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,11 +6,11 @@
6
6
 
7
7
  DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.
8
8
 
9
- 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 3.1.5.
9
+ 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 3.1.6.
10
10
 
11
11
  DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Internet Explorer (10+), Edge, Firefox and Chrome - as well as almost anything else using Blink or WebKit). It doesn't break on MSIE6 or other legacy browsers. It either uses [a fall-back](#what-about-older-browsers-like-msie8) or simply does nothing.
12
12
 
13
- **Note that DOMPurify v2.5.5 is the latest version supporting MSIE. For important security updates compatible with MSIE, please use the 2.x branch.**
13
+ **Note that DOMPurify v2.5.6 is the latest version supporting MSIE. For important security updates compatible with MSIE, please use the 2.x branch.**
14
14
 
15
15
  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 v14.x, v16.x, v17.x and v18.x, running DOMPurify on [jsdom](https://github.com/jsdom/jsdom). Older Node versions are known to work as well, but hey... no guarantees.
16
16
 
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 2.5.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.5/LICENSE */
1
+ /*! @license DOMPurify 2.5.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.6/LICENSE */
2
2
 
3
3
  'use strict';
4
4
 
@@ -283,7 +283,7 @@ function createDOMPurify() {
283
283
  * Version label, exposed for easier checks
284
284
  * if DOMPurify is up to date or not
285
285
  */
286
- DOMPurify.version = '2.5.5';
286
+ DOMPurify.version = '2.5.6';
287
287
 
288
288
  /**
289
289
  * Array of elements that DOMPurify removed during sanitation.
@@ -1145,6 +1145,13 @@ function createDOMPurify() {
1145
1145
  hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1146
1146
  _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
1147
1147
  value = hookEvent.attrValue;
1148
+
1149
+ /* Work around a security issue with comments inside attributes */
1150
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1151
+ _removeAttribute(name, currentNode);
1152
+ continue;
1153
+ }
1154
+
1148
1155
  /* Did the hooks approve of the attribute? */
1149
1156
  if (hookEvent.forceKeepAttr) {
1150
1157
  continue;
@@ -1164,12 +1171,6 @@ function createDOMPurify() {
1164
1171
  continue;
1165
1172
  }
1166
1173
 
1167
- /* Work around a security issue with comments inside attributes */
1168
- if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1169
- _removeAttribute(name, currentNode);
1170
- continue;
1171
- }
1172
-
1173
1174
  /* Sanitize attribute content to be template-safe */
1174
1175
  if (SAFE_FOR_TEMPLATES) {
1175
1176
  value = stringReplace(value, MUSTACHE_EXPR$1, ' ');