GHSA-pgjv-jrg2-gq3v dompurify vulnerable to Cross-site Scripting

Not scored Published

An attacker can execute arbitrary scripts in a victim's browser via crafted SVG content processed by the library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is GHSA-pgjv-jrg2-gq3v?

GHSA-pgjv-jrg2-gq3v is a cross-site scripting vulnerability in dompurify, published on 11 Jan 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

dompurify prior to version 2.2.2 is vulnerable to cross-site scripting when converting from SVG namespace.

Which versions are affected by GHSA-pgjv-jrg2-gq3v?

2 open source packages ship an affected version, including dompurify.

PackageAffectedFixed in
dompurify PyPIAll versions2.2.2
dompurify PyPIAll versions2.2.2

How do I fix GHSA-pgjv-jrg2-gq3v?

Upgrade dompurify to 2.2.2 or later.

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 GHSA-pgjv-jrg2-gq3v being exploited?

There is no known exploitation of GHSA-pgjv-jrg2-gq3v in the wild and no public exploit code.

Sources

Is GHSA-pgjv-jrg2-gq3v in your software?

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

Check your SBOMs for free