Critical XSS Vulnerability in node-dompurify: Nesting-based mXSS Exploit

cacti Updated 02 Oct 2025

Summary

11/10/2024
N/A
Yes i
Unrated
Not published

CVE-2024-47875: DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. Affects cacti across 3 version ranges.

< 0ef5e537a514f904b6aa1d7ad9e749e365d7185f < 1.2.16+ds1-2+deb11u5 < 6ea80cd8b47640c20f2f230c7920b1f4ce4fdf7a

Fixed in 1.2.16+ds1-2+deb11u5. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

DOMPurify is a widely used library designed to sanitize HTML, MathML, and SVG to prevent cross-site scripting (XSS) attacks. It is known for its speed and tolerance, making it a popular choice among developers for ensuring web application security. However, a recent vulnerability has been identified in the node-dompurify package, which is the Node.js implementation of DOMPurify, affecting versions prior to 2.5.0 and 3.1.3.

Vulnerability Detail

The vulnerability, identified as CVE-2024-47875, is a nesting-based mXSS (malicious cross-site scripting) issue. It arises from improper handling of nested elements, allowing attackers to inject malicious scripts that can execute in the context of the user's browser. This can lead to unauthorized access to sensitive information, session hijacking, and other malicious activities. The vulnerability affects both Debian 12 and 13 ecosystems and has been fixed in the specified versions.

How To Fix

Minimum fixed version

1.2.16+ds1-2+deb11u5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade cacti

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can implement additional input validation and sanitization on user inputs before passing them to DOMPurify. However, this is not a substitute for updating to the patched version of the library.

Conclusion

The CVE-2024-47875 vulnerability in node-dompurify poses significant risks due to its potential for mXSS attacks. It is crucial for developers using this package to update to the latest patched versions to safeguard their applications from exploitation. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.

See every vulnerability recorded for cacti →

Share this vulnerability

FAQ

CVE-2024-47875 is a critical vulnerability in the node-dompurify package that allows for nesting-based mXSS attacks, potentially compromising user data.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability can lead to unauthorized access to sensitive information, session hijacking, and execution of malicious scripts in the user's browser.

Yes, the vulnerability has been fixed in versions 2.5.0 and 3.1.3 of the node-dompurify package.

If immediate updates are not possible, implement additional input validation and sanitization as a temporary workaround until you can upgrade.

Related vulnerabilities

Recent vulnerabilities recorded for cacti.

How To Fix

Minimum fixed version

1.2.16+ds1-2+deb11u5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade cacti

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback