CVE-2024-45801 Tampering by prototype polution in DOMPurify

High 7.3 Published Updated

Attackers can bypass DOMPurify's depth checks via prototype pollution to execute cross-site scripting attacks, requiring users to upgrade the library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-45801?

CVE-2024-45801 is a high-severity cross-site scripting vulnerability in cure53 DOMPurify, published on 16 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. 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 cross site scripting (XSS) attacks. This issue has been addressed in versions 2.5.4 and 3.1.3 of DOMPurify. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-1321, CWE-1333

Which versions are affected by CVE-2024-45801?

4 open source packages ship an affected version, including dompurify. It affects 1 product.

PackageAffectedFixed in
dompurify npmAll versions2.5.4
dompurify npmAll versions2.5.4
dompurify npmFrom 3.0.03.1.3
dompurify npmFrom 3.0.03.1.3

Products include Cure53 Dompurify.

How do I fix CVE-2024-45801?

Upgrade dompurify to a fixed version for your release line: 2.5.4 or 3.1.3.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2024-45801 being exploited?

There is no known exploitation of CVE-2024-45801 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-45801, GHSA-mmhx-hmjr-r674, MINI-q7cx-7c9m-56pp, UBUNTU-CVE-2024-45801.

Is CVE-2024-45801 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free