CVE-2020-26293 Possible XSS bypass if style tag is allowed

Medium 6.1 Published Updated

Attackers can execute scripts via crafted HTML if the style tag is explicitly allowed in HtmlSanitizer, requiring an upgrade to fix.

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 CVE-2020-26293?

CVE-2020-26293 is a medium-severity cross-site scripting vulnerability in mganss HtmlSanitizer, published on 4 Jan 2021. 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

HtmlSanitizer is a .NET library for cleaning HTML fragments and documents from constructs that can lead to XSS attacks. In HtmlSanitizer before version 5.0.372, there is a possible XSS bypass if style tag is allowed. If you have explicitly allowed the `<style>` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `<style>` tag so there is no risk if you have not explicitly allowed the `<style>` tag. The problem has been fixed in version 5.0.372.

Weakness: CWE-79, CWE-74

Which versions are affected by CVE-2020-26293?

2 open source packages ship an affected version, including HtmlSanitizer. It affects 1 product.

PackageAffectedFixed in
HtmlSanitizer NuGetAll versions5.0.372
HtmlSanitizer NuGetAll versions5.0.372

Products include Htmlsanitizer Project Htmlsanitizer.

How do I fix CVE-2020-26293?

Upgrade HtmlSanitizer to 5.0.372 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 CVE-2020-26293 being exploited?

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

Sources

Also known as GHSA-8j9v-h2vp-2hhv.

Is CVE-2020-26293 in your software?

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

Check your SBOMs for free