{"id":"CVE-2020-26293","aliases":["EUVD-2021-0498","GHSA-8j9v-h2vp-2hhv"],"status":"published","title":"Possible XSS bypass if style tag is allowed","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 `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag. The problem has been fixed in version 5.0.372.","severity":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.0101,"percentile":0.63346,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-74","CWE-79"],"published":"2021-01-04T18:20:14Z","modified":"2026-10-20T10:52:58Z","fixes":[{"ecosystem":"NuGet","package":"HtmlSanitizer","fixed_in":["5.0.372"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"NuGet","package":"HtmlSanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.372"}]}]},{"source":"osv","ecosystem":"NuGet","package":"HtmlSanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.372"}]}],"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"]}],"products":[{"vendor":"htmlsanitizer_project","product":"htmlsanitizer"},{"vendor":"mganss","product":"htmlsanitizer"}],"references":[{"url":"https://github.com/mganss/HtmlSanitizer/security/advisories/GHSA-8j9v-h2vp-2hhv","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://www.nuget.org/packages/HtmlSanitizer/","tags":["x_refsource_MISC","x_transferred","Product","Third Party Advisory","advisory"]},{"url":"https://github.com/mganss/HtmlSanitizer/releases/tag/v5.0.372","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://github.com/mganss/HtmlSanitizer/commit/a3a7602a44d4155d51ec0fbbedc2a49e9c7e2eb8","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26293","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-8j9v-h2vp-2hhv"},{"url":"https://www.nuget.org/packages/HtmlSanitizer","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2020-26293","title":"Possible XSS bypass if style tag is allowed","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 `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag. The problem has been fixed in version 5.0.372.","status":"published","published":"2021-01-04T18:20:14Z","modified":"2024-08-04T15:56:03.977Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-74"],"updated_at":"2026-11-02T14:35:46.129376Z"}],"euvd":[{"id":"EUVD-2021-0498","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 `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag. The problem has been fixed in version 5.0.372.","status":"published","published":"2021-01-04T18:20:14Z","modified":"2024-08-04T15:56:03Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-03T03:07:15.778249Z"}],"ghsa":[{"id":"GHSA-8j9v-h2vp-2hhv","title":"XSS in HtmlSanitizer","description":"### Impact\n\nIf you have explicitly allowed the `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag.\n\n### Patches\n\nThe problem has been fixed in version 5.0.372.\n\n### Workarounds\n\nRemove the `\u003cstyle\u003e` tag from the set of allowed tags.\n\n### For more information\n\nIf you have any questions or comments about this advisory open an issue in https://github.com/mganss/HtmlSanitizer\n\n### Credits\n\nThis issue was discovered by Michal Bentkowski of Securitum.","status":"published","published":"2021-01-04T18:22:11Z","modified":"2023-02-01T05:05:04Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-74","CWE-79"],"updated_at":"2026-11-02T14:36:32.918681Z"}],"nvd":[{"id":"CVE-2020-26293","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 `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag. The problem has been fixed in version 5.0.372.","status":"published","published":"2021-01-04T19:15:14.97Z","modified":"2026-06-17T03:08:00.98Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/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"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-74","CWE-79"],"updated_at":"2026-11-02T14:06:28.340168Z"}],"osv":[{"id":"CVE-2020-26293","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 `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag. The problem has been fixed in version 5.0.372.","status":"published","published":"2021-01-04T19:15:14.97Z","modified":"2026-10-20T10:52:58.038027881Z","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-02T15:44:16.248747Z"},{"id":"GHSA-8j9v-h2vp-2hhv","title":"XSS in HtmlSanitizer","description":"### Impact\n\nIf you have explicitly allowed the `\u003cstyle\u003e` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `\u003cstyle\u003e` tag so there is no risk if you have not explicitly allowed the `\u003cstyle\u003e` tag.\n\n### Patches\n\nThe problem has been fixed in version 5.0.372.\n\n### Workarounds\n\nRemove the `\u003cstyle\u003e` tag from the set of allowed tags.\n\n### For more information\n\nIf you have any questions or comments about this advisory open an issue in https://github.com/mganss/HtmlSanitizer\n\n### Credits\n\nThis issue was discovered by Michal Bentkowski of Securitum.","status":"published","published":"2021-01-04T18:22:11Z","modified":"2026-09-10T03:49:14.279031332Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-74","CWE-79"],"updated_at":"2026-11-02T15:46:42.437513Z"}]}}
