Vulnerability DatabaseCVE-2026-102529

CVE-2026-102529: 
C# vulnerability analysis and mitigation

Overview

CVE-2026-102529 is a denial-of-service vulnerability in HtmlSanitizer, a .NET library for sanitizing HTML to prevent XSS attacks. The flaw, dubbed "CSS Removal DoS," exists in the CSS style-declaration sanitization logic and allows unauthenticated attackers to trigger quadratic computational complexity via crafted style attributes. It affects all stable versions prior to 9.0.967 and all beta versions from 9.1.878-beta up to (but not including) 9.1.968-beta. The vulnerability was published by the maintainer on August 7, 2026, and received a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory, Github Advisory).

Technical details

The root cause is classified as CWE-407 (Inefficient Algorithmic Complexity). The SanitizeStyleDeclaration method in HtmlSanitizer.cs previously removed disallowed CSS properties one at a time by calling RemoveProperty or SetProperty on the AngleSharp ICssStyleDeclaration object. Because AngleSharp.Css re-serializes the entire style attribute on every such mutation, processing a style declaration with n properties results in O(n²) serialization work. An attacker can craft an HTTP request containing a style attribute with a large number of CSS properties, causing the sanitizer to consume disproportionate CPU time. The fix (commit 6198e04) rebuilds the declaration once using a StringBuilder and assigns the result to styles.CssText in a single operation, reducing complexity to O(n) (GitHub Advisory, Fix Commit).

Impact

The vulnerability exclusively affects availability — there is no confidentiality or integrity impact. A single unauthenticated request can occupy one synchronous application worker for several seconds; concurrent requests compound CPU consumption and can saturate all available workers, sustaining a denial-of-service condition without any user interaction. Applications that accept user-supplied HTML and pass it through HtmlSanitizer with the style attribute permitted are directly at risk of becoming unresponsive (GitHub Advisory, Github Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported for this vulnerability. The EPSS score is approximately 0.348% (29th percentile), indicating a low near-term exploitation probability (Github Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. However, exploitation requires no authentication, no privileges, and no user interaction, making it automatable and straightforward for any attacker who can send HTTP requests to an affected application.

Exploitation steps

  1. Identify target: Locate a web application that uses HtmlSanitizer (NuGet) in a version prior to 9.0.967 or between 9.1.878-beta and 9.1.968-beta, and that accepts user-supplied HTML input with the style attribute permitted.
  2. Craft malicious payload: Construct an HTML fragment containing a style attribute with a large number of CSS property declarations (e.g., hundreds of arbitrary or disallowed properties), such as <div style="prop1:val1; prop2:val2; ... propN:valN;">.
  3. Submit requests: Send the crafted HTML to the application's input endpoint (e.g., a comment field, rich-text editor, or API accepting HTML). Each request triggers O(n²) serialization work in SanitizeStyleDeclaration, occupying a worker thread for seconds.
  4. Flood with concurrent requests: Send multiple simultaneous requests to saturate all available synchronous worker threads, causing the application to become unresponsive and sustaining denial of service (GitHub Advisory, Fix Commit).

Indicators of compromise

  • Network: High volume of HTTP requests to endpoints that accept HTML input, particularly with unusually large style attribute payloads in request bodies.
  • Logs: Application or web server logs showing repeated requests to HTML-accepting endpoints with abnormally long processing times (seconds per request); elevated HTTP 503 or timeout responses during attack periods.
  • Process/Performance: Sustained high CPU utilization on the application server process (e.g., dotnet, w3wp.exe) without a corresponding increase in legitimate traffic; all worker threads reported as busy in application performance monitoring.

Mitigation and workarounds

Upgrade HtmlSanitizer to version 9.0.967 (stable) or 9.1.968-beta (or later beta), which resolve the quadratic complexity issue by rebuilding the CSS declaration in a single pass (GitHub Advisory). As an immediate workaround if upgrading is not feasible, configure HtmlSanitizer to disallow the style attribute entirely, which prevents the vulnerable code path from being reached. Version 9.1.973 is also available and includes additional dependency updates (Release v9.1.973).

Additional resources


Source: This report was generated using AI

Related C# vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59975HIGH7.5
  • C# logoC#
  • SharpIppNext
NoYesNov 18, 2026
CVE-2026-102529HIGH7.5
  • C# logoC#
  • HtmlSanitizer
NoYesNov 17, 2026
CVE-2026-128082HIGH7.5
  • C# logoC#
  • AutoMapper
NoYesNov 13, 2026
CVE-2026-128081HIGH7.5
  • C# logoC#
  • AutoMapper
NoYesNov 13, 2026
CVE-2026-120796MEDIUM5.3
  • C# logoC#
  • Microsoft.NETCore.App.Runtime.linux-musl-x64
NoYesNov 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management