Operator Precedence Logic Error Affecting dompurify package, versions <3.4.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-DOMPURIFY-16078387
  • published16 Apr 2026
  • disclosed16 Apr 2026
  • creditUnknown

Introduced: 16 Apr 2026

New CVE NOT AVAILABLE CWE-783  (opens in a new tab)

How to fix?

Upgrade dompurify to version 3.4.0 or higher.

Overview

dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

Affected versions of this package are vulnerable to Operator Precedence Logic Error in the form of short-circuit evaluation that gives precedence to ADD_TAGS over FORBID_TAGS in _sanitizeElements(). In an application where ADD_TAGS is used as a function (via EXTRA_ELEMENT_HANDLING.tagCheck) and FORBID_TAGS is in use, an attacker can cause forbidden tags to be allowed.

CVSS Base Scores

version 4.0
version 3.1