CVE-2023-44390
HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content
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).
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.1
HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content
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).
- Record
CVE-2023-44390- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2023-2637
6.1
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).
- Record
EUVD-2023-2637- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-43cp-6p3q-2pc4
6.1
HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content
Impact
The vulnerability occurs in configurations where foreign content is allowed, i.e. either svg or math are in the list of allowed elements.
Specifically, the requirements for the vulnerability are:
- Allowing one foreign element:
svg, ormath - Comments or one raw text element:
iframe,noembed,xmp,title,noframes,styleornoscript
Configurations that meet the above requirements plus the following are vulnerable to an additional vulnerability:
- Any HTML integration element:
title,desc,mi,mo,mn,ms,mtext,annotation-xml.
In 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.
Patches
The vulnerability has been fixed in versions 8.0.723 and 8.1.722-beta (preview version).
Workarounds
Disallow foreign elements svg and math. This is the case in the default configuration, which is therefore not affected by the vulnerability.
- Record
GHSA-43cp-6p3q-2pc4- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
6.1
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).
- Record
CVE-2023-44390- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
6.1
HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content
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).
- Record
CVE-2023-44390- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVGHSA-43cp-6p3q-2pc4
6.1
HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content
Impact
The vulnerability occurs in configurations where foreign content is allowed, i.e. either svg or math are in the list of allowed elements.
Specifically, the requirements for the vulnerability are:
- Allowing one foreign element:
svg, ormath - Comments or one raw text element:
iframe,noembed,xmp,title,noframes,styleornoscript
Configurations that meet the above requirements plus the following are vulnerable to an additional vulnerability:
- Any HTML integration element:
title,desc,mi,mo,mn,ms,mtext,annotation-xml.
In 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.
Patches
The vulnerability has been fixed in versions 8.0.723 and 8.1.722-beta (preview version).
Workarounds
Disallow foreign elements svg and math. This is the case in the default configuration, which is therefore not affected by the vulnerability.
- Record
GHSA-43cp-6p3q-2pc4- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
HtmlSanitizerNuGet |
before 8.0.723 | 8.0.723 |
HtmlSanitizerNuGet |
8.1.0-beta up to 8.1.722-beta | 8.1.722-beta |
HtmlSanitizerNuGet |
before 8.0.723, plus listed versions 1.0.4925.298151.0.4927.308731.1.5243.284481.1.5297.284031.1.5338.17998 Show 45 moreShow less2.0.5449.205502.0.5548.249322.0.5595.221832.0.5595.303252.0.5623.304652.0.5735.242963.0.5781.31354-beta3.0.66-beta3.1.67-beta3.1.75-beta3.1.763.1.793.1.913.1.933.1.983.2.100-beta3.2.1033.2.1053.2.96-beta3.3.122-beta3.3.125-beta3.3.126-beta3.3.127-beta3.3.128-beta3.3.129-beta3.3.130-beta3.3.131-beta3.3.132-beta3.3.1423.3.143-beta3.3.144-beta3.3.145-beta3.3.146-beta3.3.147-beta3.3.148-beta3.4.152-beta3.4.1563.5.168-beta3.5.169-beta4.0.1794.0.1804.0.1814.0.1824.0.1834.0.185 |
8.0.723 |
HtmlSanitizerNuGet |
8.1.0-beta up to 8.1.722-beta, plus listed versions 8.1.717-beta8.1.719-beta |
8.1.722-beta |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-44390 is a medium vulnerability (CVSS 6.1) in Htmlsanitizer Project Htmlsanitizer, published October 4, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.42%, the 36th percentile. Fixed in HtmlSanitizer 8.0.723.
References
github.com/mganss/HtmlSanitizer/security/advisories/GHSA-43cp-6p3q-2pc4
github.com/mganss/HtmlSanitizer/commit/ab29319866c020f0cc11e6b92228cd8039196c6e
nvd.nist.gov/vuln/detail/CVE-2023-44390
github.com/advisories/GHSA-43cp-6p3q-2pc4
github.com/CVEProject/cvelistV5/tree/main/cves/2023/44xxx/CVE-2023-44390.json
github.com/mganss/HtmlSanitizer
Left out here: 45 versions. The JSON record has them.