Cloudanix VulnDB

CVE-2024-45801

High · 7.3

DOMPurify allows tampering by prototype pollution

CVSS

7.3

EPSS

0.9%

Published

Sep 16, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A widely used tool that cleans web page content can be tricked into letting harmful code slip through, putting any site that relies on it at risk of unauthorized script execution.

Exploitation
Requires User Interaction
Attacker needs
None
Complexity
Low
Impact
Other
Component
Library
Class
XSS
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

Malicious HTML with crafted nesting bypasses DOMPurify depth checks; Prototype Pollution can further weaken those checks, allowing arbitrary script execution via XSS.

Why it matters to the business

Attackers can execute unauthorized scripts in user browsers, enabling theft of session tokens, account takeover, or unauthorized actions within any application relying on this library.

How an attack unfolds

An attacker supplies specially nested HTML combined with prototype-pollution properties to a DOMPurify instance; the library's sanitization fails, returning executable script that runs in the victim's browser context.

How to fix it

Upgrade cure53/dompurify to a version containing commit 1e520262bf4c66b5efda49e2316d6d1246ca7b21 (3.x) or 26e1d69ca7f769f5c558619d644d90dd8bf26ebc (2.x); replace all direct Git references with the patched commit 10c12610b15875ea09129c35fca28a886857434f or later releases.

How to confirm the fix worked

Confirm the installed DOMPurify version includes one of the listed fix commits; re-run the library against the original bypass test cases and verify that depth-limited and polluted inputs are now rejected.

Typical attack path

  1. Identify an application endpoint that processes untrusted HTML through DOMPurify
  2. Craft a payload using deep nesting and prototype-pollution keys to evade depth limits
  3. Submit the payload via user-controlled input such as comments, rich text, or profile fields
  4. Confirm the sanitized output still contains executable script tags or event handlers
  5. Leverage the resulting XSS for session hijacking or data exfiltration

How to detect it

Inspect web-application logs and browser telemetry for unexpected script execution or HTML fragments that contain event handlers or script tags after sanitization; correlate with requests to endpoints known to invoke DOMPurify.

What your security team should do

  • Immediately replace all instances of DOMPurify with a build containing the referenced fix commits
  • Audit downstream packages and rebuild any bundled or vendored copies of the library
  • Add automated dependency scanning to detect future unpatched versions of DOMPurify
  • Review application inputs that feed DOMPurify and apply additional server-side validation where feasible

The record

It has been discovered that malicious HTML using special nesting techniques can bypass the depth checking added to DOMPurify in recent releases. It was also possible to use Prototype Pollution to weaken the depth check. This renders dompurify unable to avoid XSS attack. Fixed by https://github.com/cure53/DOMPurify/commit/1e520262bf4c66b5efda49e2316d6d1246ca7b21 (3.x branch) and https://github.com/cure53/DOMPurify/commit/26e1d69ca7f769f5c558619d644d90dd8bf26ebc (2.x branch).

Affected packages

Ecosystem Package Introduced Fixed
npm dompurify 0 2.5.4
npm dompurify 3.0.0 3.1.3
Chainguard argo-workflow-cli 0 3.6.0-r0
Chainguard argo-workflow-controller 0 3.6.0-r0
Chainguard argo-workflow-controller-compat 0 3.6.0-r0
Chainguard argo-workflow-executor 0 3.6.0-r0
Chainguard argo-workflow-executor-compat 0 3.6.0-r0
Chainguard argo-workflows 0 3.6.0-r0
Chainguard argo-workflows-known-hosts 0 3.6.0-r0
Chainguard argo-workflows-ui 0 3.6.0-r0
Chainguard opensearch-dashboards-2 0 2.19.1-r3
Chainguard opensearch-dashboards-2-alerting-dashboards-plugin 0 2.19.1-r3
Chainguard opensearch-dashboards-2-anomaly-detection-dashboards-plugin 0 2.19.1-r3
Chainguard opensearch-dashboards-2-compat 0 2.19.1-r3
Chainguard opensearch-dashboards-2-config 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-maps 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-notifications 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-observability 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-query-workbench 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-reporting 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-search-relevance 0 2.19.1-r3
Chainguard opensearch-dashboards-2-dashboards-visualizations 0 2.19.1-r3
Chainguard opensearch-dashboards-2-fips 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-alerting-dashboards-plugin 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-anomaly-detection-dashboards-plugin 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-config 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-maps 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-notifications 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-observability 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-query-workbench 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-reporting 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-search-relevance 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-dashboards-visualizations 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-index-management-dashboards-plugin 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-ml-commons-dashboards 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-security-analytics-dashboards-plugin 0 2.17.1-r0
Chainguard opensearch-dashboards-2-fips-security-dashboards-plugin 0 2.17.1-r0
Chainguard opensearch-dashboards-2-index-management-dashboards-plugin 0 2.19.1-r3
Chainguard opensearch-dashboards-2-ml-commons-dashboards 0 2.19.1-r3
Chainguard opensearch-dashboards-2-security-analytics-dashboards-plugin 0 2.19.1-r3
Chainguard opensearch-dashboards-2-security-dashboards-plugin 0 2.19.1-r3
Debian:12 node-dompurify 0 2.4.1+dfsg+~2.4.0-2+deb12u1
Red Hat:ansible_automation_platform:2.4::el8 ansible-core 0 1:2.15.13-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-venv-tower 0 0:4.5.13-1.el8ap
Red Hat:ansible_automation_platform:2.4::el9 ansible-core 0 1:2.15.13-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-venv-tower 0 0:4.5.13-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el8 ansible-core 0 1:2.15.13-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el8 automation-controller-venv-tower 0 0:4.5.13-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el9 ansible-core 0 1:2.15.13-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 automation-controller-venv-tower 0 0:4.5.13-1.el9ap
Red Hat:ansible_automation_platform_inside:2.4::el8 ansible-core 0 1:2.15.13-1.el8ap
Red Hat:ansible_automation_platform_inside:2.4::el9 ansible-core 0 1:2.15.13-1.el9ap
Ubuntu:22.04:LTS node-dompurify 0 No fix
Ubuntu:24.04:LTS node-dompurify 0 No fix
Ubuntu:24.10 node-dompurify 0 No fix
Ubuntu:25.04 node-dompurify 0 No fix
Ubuntu:25.10 node-dompurify 0 No fix
Wolfi argo-workflow-cli 0 3.6.0-r0
Wolfi argo-workflow-controller 0 3.6.0-r0
Wolfi argo-workflow-controller-compat 0 3.6.0-r0
Wolfi argo-workflow-executor 0 3.6.0-r0
Wolfi argo-workflow-executor-compat 0 3.6.0-r0
Wolfi argo-workflows 0 3.6.0-r0
Wolfi argo-workflows-known-hosts 0 3.6.0-r0
Wolfi argo-workflows-ui 0 3.6.0-r0
Wolfi opensearch-dashboards-2 0 2.19.1-r3
Wolfi opensearch-dashboards-2-alerting-dashboards-plugin 0 2.19.1-r3
Wolfi opensearch-dashboards-2-anomaly-detection-dashboards-plugin 0 2.19.1-r3
Wolfi opensearch-dashboards-2-compat 0 2.19.1-r3
Wolfi opensearch-dashboards-2-config 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-maps 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-notifications 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-observability 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-query-workbench 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-reporting 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-search-relevance 0 2.19.1-r3
Wolfi opensearch-dashboards-2-dashboards-visualizations 0 2.19.1-r3
Wolfi opensearch-dashboards-2-index-management-dashboards-plugin 0 2.19.1-r3
Wolfi opensearch-dashboards-2-ml-commons-dashboards 0 2.19.1-r3
Wolfi opensearch-dashboards-2-security-analytics-dashboards-plugin 0 2.19.1-r3
Wolfi opensearch-dashboards-2-security-dashboards-plugin 0 2.19.1-r3

Related vulnerabilities