Inefficient Algorithmic Complexity Affecting htmlsanitizer package, versions [3.0.66-beta, 9.0.967)[9.1.878-beta, 9.1.968-beta)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.48% (44th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-DOTNET-HTMLSANITIZER-22744930
  • published23 Nov 2026
  • disclosed19 Nov 2026
  • creditYounghun Ko

Introduced: 19 Nov 2026

NewCVE-2026-102529  (opens in a new tab)
CWE-407  (opens in a new tab)

How to fix?

Upgrade HtmlSanitizer to version 9.0.967, 9.1.968-beta or higher.

Overview

HtmlSanitizer is a Cleans HTML from constructs that can be used for cross site scripting (XSS).

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the SanitizeStyleDeclaration method, which removes each disallowed CSS declaration with a separate RemoveProperty call, and AngleSharp re-serializes the entire style declaration on every call. An attacker can occupy a worker thread for seconds per request by submitting HTML whose style attribute contains a large number of declarations that the sanitizer removes or rewrites, and concurrent requests can exhaust all workers. This requires that the application sanitizes attacker-supplied HTML with the style attribute allowed, which is the default configuration.

Workaround

This vulnerability can be avoided by removing style from the sanitizer's allowed attributes.

CVSS Base Scores

version 4.0
version 3.1