Mganss HtmlSanitizer
HtmlSanitizer: CSS Removal DoS
HtmlSanitizer is a .NET library for cleaning HTML fragments and documents from constructs that can lead to XSS attacks. Prior to 9.0.967 and 9.1.968-beta, HtmlSanitizer CSS style-declaration sanitization can process an attacker-controlled style attribute with quadratic cost because SanitizeStyleDeclaration repeatedly causes the complete declaration to be serialized while removing disallowed CSS properties. One unauthenticated request can occupy a synchronous application worker for seconds, and concurrent requests can saturate all workers and sustain denial of service. This issue is fixed in versions 9.0.967 and 9.1.968-beta.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 9.0.967
- >= 9.1.878-beta, < 9.1.968-beta
Fixed in 9.0.967, 9.1.968-beta
Mitigation
Upgrade HtmlSanitizer to 9.0.967 or 9.1.968-beta or later.
References
- Vendor advisory github.com/mganss/HtmlSanitizer/security/advis…
- Patch github.com/mganss/HtmlSanitizer/commit/6198e04…
- Release notes github.com/mganss/HtmlSanitizer/releases/tag/v…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.