CVE-2023-44390: HtmlSanitizer Cross-Site Scripting Vulnerability
MODERATECVE-2023-44390 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting HtmlSanitizer libraries in the NuGet ecosystem. The issue involves htmlsanitizer vulnerable to cross-site scripting in foreign content. Remediation is available by upgrading affected packages to version 8.0.723, 8.1.722-beta.
CVE-2023-44390 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2023-44390
To remediate this vulnerability, upgrade all affected HtmlSanitizer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade HtmlSanitizer to 8.0.723
Upgrade HtmlSanitizer to 8.1.722-beta
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for HtmlSanitizer
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-44390, inspect your project dependencies for HtmlSanitizer:
inspect dependencies for HtmlSanitizer
Analyze the terminal output to locate any version of HtmlSanitizer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.723), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In HtmlSanitizer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-44390 Affected HtmlSanitizer Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
HtmlSanitizer
|
NuGet |
< 8.0.723
|
8.0.723
|
|
HtmlSanitizer
|
NuGet |
≥ 8.1.0-beta
< 8.1.722-beta
|
8.1.722-beta
|
References
Frequently Asked Questions
What is CVE-2023-44390?
Which HtmlSanitizer versions are affected?
What version fixes CVE-2023-44390?
Is HtmlSanitizer affected?
What is the CVSS score of CVE-2023-44390?
What CWE is associated with CVE-2023-44390?
How can I check NuGet dependencies for CVE-2023-44390?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-43cp-6p3q-2pc4",
"modified" : "2023-10-05T19:39:51Z",
"published" : "2023-10-04T18:52:35Z",
"aliases" : [ "CVE-2023-44390" ],
"summary" : "HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content",
"details" : "### Impact\n\nThe vulnerability occurs in configurations where foreign content is allowed, i.e. either `svg` or `math` are in the list of allowed elements.\nSpecifically, the requirements for the vulnerability are:\n\n1. Allowing one foreign element: `svg`, or `math`\n2. Comments or one raw text element: `iframe`, `noembed`, `xmp`, `title`, `noframes`, `style` or `noscript`\n\nConfigurations that meet the above requirements plus the following are vulnerable to an additional vulnerability:\n\n- Any HTML integration element: `title`, `desc`, `mi`, `mo`, `mn`, `ms`, `mtext`, `annotation-xml`.\n\nIn case an application sanitizes user input with a vulnerable configuration, an attacker could\nbypass the sanitization and inject arbitrary HTML, including JavaScript code.\n\nNote that in the default configuration the vulnerability is not present.\n\n### Patches\n\nThe vulnerability has been fixed in versions 8.0.723 and 8.1.722-beta (preview version).\n\n### Workarounds\n\nDisallow foreign elements `svg` and `math`. This is the case in the default configuration, which is therefore not affected by the vulnerability.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "NuGet",
"name" : "HtmlSanitizer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.0.723"
} ]
} ]
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "HtmlSanitizer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.1.0-beta"
}, {
"fixed" : "8.1.722-beta"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mganss/HtmlSanitizer/security/advisories/GHSA-43cp-6p3q-2pc4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-44390"
}, {
"type" : "WEB",
"url" : "https://github.com/mganss/HtmlSanitizer/commit/ab29319866c020f0cc11e6b92228cd8039196c6e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mganss/HtmlSanitizer"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-04T18:52:35Z",
"nvd_published_at" : "2023-10-05T14:15:09Z"
}
}