Before displaying HTML written by users as is, such as in contact forms, CMS content or email bodies, applications sometimes insert a step that removes scripts and dangerous attributes. In .NET, HtmlSanitizer (the Ganss.Xss namespace) is a NuGet package for this purpose. It is a component for preventing XSS, but the package itself had an issue where crafted input could stall processing for a long time.
This HtmlSanitizer issue (GHSA-464h-4j8h-q5mf, CVE-2026-102529, HIGH) was disclosed as a repository advisory on August 7, 2026. It was registered in NVD on November 17 and added to the GitHub Advisory Database as reviewed on November 19. It affects versions earlier than 9.0.967 (for the beta line, 9.1.878-beta and later but earlier than 9.1.968-beta), and 9.0.967 was released on NuGet on July 21. According to GitHub's documentation, Dependabot alerts are based on reviewed advisories. So even if an alert first appeared on or after November 19, the fixed version had been available since July. In this article, we use the advisory and the fix commit to explain what happened and how to update.
Consequence
The advisory's description is short and states the impact as follows.
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.
In other words, a single request from someone who is not logged in can tie up the worker handling it for several seconds, and if such requests are sent at the same time, all workers could be occupied. Applications with publicly accessible input fields that accept HTML are the most exposed.
The cause lies in the process that removes CSS from style attributes. HtmlSanitizer removes disallowed CSS properties and values containing disallowed URLs from style attributes one at a time. According to a comment added in the fix commit (6198e04, July 21), AngleSharp.Css, which it uses internally, rebuilds the entire style attribute as a string every time a single property is set or removed. As a result, with N declarations to remove, the amount of work grew in proportion to the square of N.
The fix first collects the declarations to remove and to rewrite, then rebuilds the style attribute only once at the end. The event called before removal (RemovingStyle) is still called as before, and canceling it keeps the declaration.

The default settings are affected
The style attribute is among the attributes HtmlSanitizer allows by default (see the list of default attributes in the README and HtmlSanitizerDefaults.cs). Applications that use new HtmlSanitizer() as is let style attributes through, so they meet the conditions for this issue.
The advisory gives one workaround: "Disallow the style attribute." If users do not need to change text color or layout in their input, remove style from the allowed attributes.
var sanitizer = new HtmlSanitizer();
// 更新できるまでのつなぎ。style属性ごと取り除く
sanitizer.AllowedAttributes.Remove("style");
However, removing the style attribute also removes colors and layout that users applied in the editor. Confirm that the change in display is acceptable before applying it.
Which version to update to
The versions and release dates (UTC) on NuGet are as follows. The fix commit is included in tags from 9.1.973 onward (the 9.1, 9.2, 10.0 and 11.0 lines).
| Release line | Versions with the fix | Latest as of November 24 |
|---|---|---|
| 9.0 line | 9.0.967 (July 21) | 9.0.967 |
| 9.1 line | 9.1.968-beta (July 21); stable release 9.1.973 (July 27) | 9.1.982 (August 3) |
| 9.2 line | All from 9.2.995 (August 10) onward | 9.2.1039 (August 28) |
| 10.0 line | Stable release 10.0.1120 (November 2) | 10.0.1120 |
| 11.0 line | 11.0.26 (November 9; 11.0.16 has been unlisted on NuGet) | 11.0.26 |
We think updating to the fixed version in the same line makes it easier to keep changes in output smaller than updating across lines (this is the editorial team's view; we have not compared outputs).
However, a separate issue (GHSA-x83r-fr5c-qqvj, LOW) was also disclosed in the repository on November 2. If you use the entire document returned by SanitizeDom(string), attributes such as <body onload=...> remain without being removed. It is fixed in 9.2.1039 and 10.0.1037-beta and later, and the stable releases of the 10.0 and 11.0 lines (10.0.1120 and 11.0.26) also include a commit with the same change (96afbc8). It is not included in 9.0.967 or the 9.1 line. According to the advisory, you are not affected if you use only Sanitize(string) or read only dom.Body.InnerHtml. If you use SanitizeDom, choose 9.2.1039 or later. As of November 24, this issue is not in the GitHub Advisory Database and does not appear in Dependabot alerts.
Steps to check (editorial suggestion)
- Check the version. Look for
HtmlSanitizerwithdotnet list package --include-transitive. Because it may be installed as a dependency of another package, add--include-transitive. If it is earlier than 9.0.967 (earlier than 9.1.968-beta for betas), you need to update. - Check the input paths. See whether what you pass to HtmlSanitizer is input that people who are not logged in can send (inquiries, comments, emails received from outside). If it is a screen where only internal administrators enter content, the priority is lower.
- Update and compare the output. The fix reduces the number of rebuilds, but it also changes how the style attribute string is built. In a test environment, check that the sanitized results of your usual input (content with colors or bold applied in the editor) are the same before and after the update.
- Put a limit on input size. Limiting the length of input fields that accept HTML and the time spent on a single operation also helps when a similar problem is found in another component.
Scope of verification
On November 22–24, 2026, we reviewed the repository disclosure date of GHSA-464h-4j8h-q5mf and its listing date in the GitHub Advisory Database, the NVD description, the description of GHSA-x83r-fr5c-qqvj, the diff of commit 6198e04 in mganss/HtmlSanitizer and the tags containing that commit, the README and
HtmlSanitizerDefaults.cs(v11.0.26), and the versions and release dates on NuGet (document research). Our working environment did not have .NET, so we did not reproduce the processing time or compare outputs before and after the update.
For .NET business systems, the support end date of the framework itself also affects update decisions. See also our article on the end of support for .NET 8 and 9. We also covered a problem where input processing time grows sharply in our article on Ruby regular expressions.
GleamHub's development, AI and automation consulting covers maintaining business systems built with .NET and planning dependency updates. Please reach out through our contact form.
References
- GHSA-464h-4j8h-q5mf: CSS Removal DoS(mganss/HtmlSanitizer)
- GHSA-464h-4j8h-q5mf: HtmlSanitizer: CSS Removal DoS(github/advisory-database)
- GHSA-x83r-fr5c-qqvj: SanitizeDom(string) fails to sanitize attributes merged onto wrapper elements(mganss/HtmlSanitizer)
- mganss/HtmlSanitizer — commit 6198e04(Fix algorithmic complexity issue)
- mganss/HtmlSanitizer — README.md
- HtmlSanitizer(NuGet)
- GitHub Docs — About the GitHub Advisory database









