{"id":"CVE-2020-26293","aliases":["CVE-2020-26293","GHSA-8j9v-h2vp-2hhv"],"related":[],"kind":"vulnerability","state":"published","title":"Possible XSS bypass if style tag is allowed","summary":"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 `<style>` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `<style>` tag so there is no risk if you have not explicitly allowed the `<style>` tag. The problem has been fixed in version 5.0.372.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 `<style>` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `<style>` tag so there is no risk if you have not explicitly allowed the `<style>` tag. The problem has been fixed in version 5.0.372.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nIf you have explicitly allowed the `<style>` tag, an attacker could craft HTML that includes script after passing through the sanitizer. The default settings disallow the `<style>` tag so there is no risk if you have not explicitly allowed the `<style>` tag.\n\n### Patches\n\nThe problem has been fixed in version 5.0.372.\n\n### Workarounds\n\nRemove the `<style>` 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"HtmlSanitizer es una biblioteca .NET para limpiar fragmentos HTML y documentos de construcciones que pueden conllevar a ataques de tipo XSS.&#xa0;En HtmlSanitizer versiones anteriores a 5.0.372, se presenta una posible omisión de XSS si la etiqueta de estilo es permitida.&#xa0;Si ha permitido explícitamente la etiqueta \"(style)\", un atacante podría crear HTML que incluya un script después de pasar a través del sanitizador.&#xa0;La configuración predeterminada no permite la etiqueta \"(style)\", por lo que no existe riesgo si no ha permitido explícitamente la etiqueta \"(style)\".&#xa0;El problema ha sido corregido en la versión 5.0.372.","source":"nvd"}],"published":"2021-01-04T18:20:14.000Z","modified":"2026-09-10T03:49:14.279Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N","score":6.1,"rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-74","CWE-79"],"affected":[{"ranges":[{"version":"< 5.0.372","status":"affected"}],"vendor":"mganss","product":"HtmlSanitizer","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.0.372"}],"ecosystem":"NuGet","package":"HtmlSanitizer","purl":"pkg:nuget/HtmlSanitizer","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.0.372"}],"vendor":"htmlsanitizer_project","product":"htmlsanitizer","cpe":"cpe:2.3:a:htmlsanitizer_project:htmlsanitizer:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/mganss/HtmlSanitizer/security/advisories/GHSA-8j9v-h2vp-2hhv","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.nuget.org/packages/HtmlSanitizer/","tags":["product","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/mganss/HtmlSanitizer/releases/tag/v5.0.372","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mganss/HtmlSanitizer/commit/a3a7602a44d4155d51ec0fbbedc2a49e9c7e2eb8","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26293","tags":["advisory"],"sources":["ghsa"]},{"url":"https://www.nuget.org/packages/HtmlSanitizer","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-26293","url":"https://www.cve.org/CVERecord?id=CVE-2020-26293","licence":"CVE Terms of Use","modified":"2024-08-04T15:56:03.977Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8j9v-h2vp-2hhv","url":"https://github.com/advisories/GHSA-8j9v-h2vp-2hhv","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:14.279Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-26293","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26293","licence":"Public domain","modified":"2026-06-17T03:08:00.980Z"}],"updatedAt":"2026-11-25T22:57:56.855Z","epss":{"score":0.0101,"percentile":0.64073,"date":"2026-12-01T12:00:22.000Z"}}