Skip to content

Commit f051738

Browse files
committed
fix: Fixed an off-by-one with the nesting counter causing over-sanitization
1 parent c725ce0 commit f051738

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

dist/purify.cjs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ function createDOMPurify() {
516516
let CONFIG = null;
517517

518518
/* Specify the maximum element nesting depth to prevent mXSS */
519-
const MAX_NESTING_DEPTH = 511;
519+
const MAX_NESTING_DEPTH = 512;
520520

521521
/* Ideally, do not touch anything below this line */
522522
/* ______________________________________________ */
@@ -1388,7 +1388,7 @@ function createDOMPurify() {
13881388
}
13891389

13901390
/* Remove an element if nested too deeply to avoid mXSS */
1391-
if (depth >= MAX_NESTING_DEPTH) {
1391+
if (depth > MAX_NESTING_DEPTH) {
13921392
_forceRemove(currentNode);
13931393
}
13941394

dist/purify.es.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/purify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ function createDOMPurify(window = getGlobal()) {
389389
let CONFIG = null;
390390

391391
/* Specify the maximum element nesting depth to prevent mXSS */
392-
const MAX_NESTING_DEPTH = 511;
392+
const MAX_NESTING_DEPTH = 512;
393393

394394
/* Ideally, do not touch anything below this line */
395395
/* ______________________________________________ */
@@ -1511,7 +1511,7 @@ function createDOMPurify(window = getGlobal()) {
15111511
}
15121512

15131513
/* Remove an element if nested too deeply to avoid mXSS */
1514-
if (depth >= MAX_NESTING_DEPTH) {
1514+
if (depth > MAX_NESTING_DEPTH) {
15151515
_forceRemove(currentNode);
15161516
}
15171517

0 commit comments

Comments
 (0)