NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · NuGet

CVE-2026-102529: HtmlSanitizer: CSS Removal DoS

highCVSS 3.1 7.5GHSA-464h-4j8h-q5mf

The HtmlSanitizer NuGet package has an algorithmic complexity flaw in its CSS removal. An unauthenticated request can occupy a synchronous worker for seconds, and concurrent requests can keep every worker busy. Fixed in 9.0.967 and 9.1.968-beta. Disallowing the style attribute is a workaround.

Published Nov 19, 2026 · Analysis Nov 19, 2026

What an attacker can do

HtmlSanitizer cleans untrusted HTML, including the CSS in style attributes. The advisory says the CSS removal step takes disproportionate CPU on crafted input (CWE-407). It does not publish the exact input pattern.

An attacker who can submit HTML that your application sanitizes, such as comments, rich text or email bodies, needs no account or user action. Each crafted request ties up one worker for seconds. Several in parallel can saturate the workers and deny service to everyone. Only availability is affected. Applications that sanitize synchronously on request threads feel it most.

Who is affected

HtmlSanitizer below 9.0.967 on the stable line, and 9.1.878-beta up to but not including 9.1.968-beta on the beta line. Check:

dotnet list package | grep HtmlSanitizer

and look for it in transitive packages with dotnet list package --include-transitive.

HtmlSanitizer

Ecosystem
NuGet
Affected
< 9.0.967
Fixed in
9.0.967
Check
dotnet list package --include-transitive

HtmlSanitizer

Ecosystem
NuGet
Affected
>= 9.1.878-beta, < 9.1.968-beta
Fixed in
9.1.968-beta
Check
dotnet list package --include-transitive

How to fix it

Upgrade HtmlSanitizer to 9.0.967 or, on the beta line, 9.1.968-beta:

dotnet add package HtmlSanitizer --version 9.0.967

The advisory's workaround is to disallow the style attribute in the sanitizer's allowed attributes, so no CSS is processed. A release 9.1.973 is also referenced by the advisory.

How to tell if you were hit

Watch for requests with long processing times and CPU spikes in endpoints that sanitize HTML. Request logs with large style attributes from a single client point to an attack. Check dependency lists for versions below the patched ones.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

An unauthenticated request can occupy one synchronous application worker for seconds. Concurrent requests add CPU cost and can keep all workers busy, sustaining denial of service without user interaction.

Patches

The issue has been patched in versions 9.0.967 and 9.1.968-beta.

Workarounds

Disallow the style attribute.

Credited to koyokr.

Questions

Does CVE-2026-102529 need authentication?

No. The advisory says an unauthenticated request can occupy a worker, with no user interaction.

Can I avoid it without upgrading?

Yes. Disallow the style attribute, so the CSS removal code never runs.

Which versions are fixed?

9.0.967 on the stable line and 9.1.968-beta on the beta line.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More NuGet vulnerabilities

All NuGet entries