CVE-2020-26293 is a medium-severity (CVSS 6.1) CWE-74 vulnerability in HtmlSanitizer. A fix is available for HtmlSanitizer — see the affected versions and patch details below.
XSS in HtmlSanitizer
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
HtmlSanitizerReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.
Description
Impact
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.
Patches
The problem has been fixed in version 5.0.372.
Workarounds
Remove the <style> tag from the set of allowed tags.
For more information
If you have any questions or comments about this advisory open an issue in https://github.com/mganss/HtmlSanitizer
Credits
This issue was discovered by Michal Bentkowski of Securitum.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| .NETNuGet | HtmlSanitizer | all versions | 5.0.372dotnet add package HtmlSanitizer --version 5.0.372 |
Affected Products
htmlsanitizerhtmlsanitizer_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for HtmlSanitizer, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update HtmlSanitizer to 5.0.372 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2020-26293 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2020-26293 in your dependencies?
Find it across NuGet, including transitive dependencies.