{"id":"CVE-2023-44390","aliases":["EUVD-2023-2637","GHSA-43cp-6p3q-2pc4"],"status":"published","title":"HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content","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).","severity":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00416,"percentile":0.36369,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2023-10-04T18:52:35Z","modified":"2026-10-28T02:30:52Z","fixes":[{"ecosystem":"NuGet","package":"HtmlSanitizer","fixed_in":["8.0.723","8.1.722-beta"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"NuGet","package":"HtmlSanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.0.723"}]}]},{"source":"ghsa","ecosystem":"NuGet","package":"HtmlSanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.1.0-beta"},{"fixed":"8.1.722-beta"}]}]},{"source":"osv","ecosystem":"NuGet","package":"HtmlSanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.0.723"}]}],"versions":["1.0.4925.29815","1.0.4927.30873","1.1.5243.28448","1.1.5297.28403","1.1.5338.17998","2.0.5449.20550","2.0.5548.24932","2.0.5595.22183","2.0.5595.30325","2.0.5623.30465","2.0.5735.24296","3.0.5781.31354-beta","3.0.66-beta","3.1.67-beta","3.1.75-beta","3.1.76","3.1.79","3.1.91","3.1.93","3.1.98","3.2.100-beta","3.2.103","3.2.105","3.2.96-beta","3.3.122-beta","3.3.125-beta","3.3.126-beta","3.3.127-beta","3.3.128-beta","3.3.129-beta","3.3.130-beta","3.3.131-beta","3.3.132-beta","3.3.142","3.3.143-beta","3.3.144-beta","3.3.145-beta","3.3.146-beta","3.3.147-beta","3.3.148-beta","3.4.152-beta","3.4.156","3.5.168-beta","3.5.169-beta","4.0.179","4.0.180","4.0.181","4.0.182","4.0.183","4.0.185","4.0.187","4.0.197","4.0.199","4.0.201","4.0.204","4.0.205","4.0.207","4.0.210","4.0.217","5.0.215-beta","5.0.218-beta","5.0.250-beta","5.0.266-beta","5.0.274-beta","5.0.298","5.0.304","5.0.310","5.0.319","5.0.331","5.0.342","5.0.343","5.0.353","5.0.355","5.0.372","5.0.376","5.0.404","6.0.409-beta","6.0.423-beta","6.0.430-beta","6.0.437","6.0.441","6.0.453","7.0.470-beta","7.0.473","7.1.475","7.1.488","7.1.509","7.1.512","7.1.542","8.0.601","8.0.645","8.0.690-beta","8.0.691-beta","8.0.692","8.0.718"]},{"source":"osv","ecosystem":"NuGet","package":"HtmlSanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.1.0-beta"},{"fixed":"8.1.722-beta"}]}],"versions":["8.1.717-beta","8.1.719-beta"]}],"products":[{"vendor":"htmlsanitizer_project","product":"htmlsanitizer"},{"vendor":"mganss","product":"htmlsanitizer"}],"references":[{"url":"https://github.com/mganss/HtmlSanitizer/security/advisories/GHSA-43cp-6p3q-2pc4","tags":["x_refsource_CONFIRM","x_transferred","Vendor Advisory","advisory","web"]},{"url":"https://github.com/mganss/HtmlSanitizer/commit/ab29319866c020f0cc11e6b92228cd8039196c6e","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-44390","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-43cp-6p3q-2pc4"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/44xxx/CVE-2023-44390.json","tags":["advisory"]},{"url":"https://github.com/mganss/HtmlSanitizer","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2023-44390","title":"HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content","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).","status":"published","published":"2023-10-05T13:41:20.387Z","modified":"2024-09-19T17:32:06.969Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:35:21.612665Z"}],"euvd":[{"id":"EUVD-2023-2637","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).","status":"published","published":"2023-10-05T13:41:20Z","modified":"2024-09-19T17:32:06Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T00:28:18.665654Z"}],"ghsa":[{"id":"GHSA-43cp-6p3q-2pc4","title":"HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content","description":"### 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","status":"published","published":"2023-10-04T18:52:35Z","modified":"2023-11-09T05:01:55Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:37:17.64478Z"}],"nvd":[{"id":"CVE-2023-44390","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).","status":"published","published":"2023-10-05T14:15:09.737Z","modified":"2026-06-17T06:27:32.93Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:08:35.022405Z"}],"osv":[{"id":"CVE-2023-44390","title":"HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content","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).","status":"published","published":"2023-10-05T13:41:20.387Z","modified":"2026-10-28T02:30:52.212305742Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:33.792101Z"},{"id":"GHSA-43cp-6p3q-2pc4","title":"HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content","description":"### 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","status":"published","published":"2023-10-04T18:52:35Z","modified":"2026-09-10T03:49:25.762888244Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:36.434231Z"}]}}
