CVE-2023-51652
C# vulnerability analysis and mitigation

Overview

OWASP AntiSamy .NET, a library for performing cleansing of HTML from untrusted sources, was found to contain a mutation cross-site scripting (mXSS) vulnerability (CVE-2023-51652) prior to version 1.2.0. The vulnerability was disclosed on January 2, 2024, and affects all versions of the library before 1.2.0 (GitHub Advisory).

Technical details

The vulnerability is caused by flawed parsing of HTML being sanitized when the preserveComments directive is enabled in the policy file along with certain allowed tags. The issue allows crafted inputs to result in elements within comment tags being interpreted as executable code when using AntiSamy's sanitized output. The vulnerability has been assigned a CVSS v3.1 base score of 6.1 (Medium) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N (GitHub Advisory).

Impact

When successfully exploited, this vulnerability could allow attackers to execute malicious JavaScript code in the context of the user's browser through mutation-based cross-site scripting attacks. This could potentially lead to unauthorized access to sensitive information, session hijacking, or other client-side attacks (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in OWASP AntiSamy .NET version 1.2.0 and later. For users unable to upgrade immediately, a temporary workaround is available: manually edit the AntiSamy policy file (antisamy.xml) by either deleting the preserveComments directive or setting its value to false. Additionally, it is recommended to remove the noscript tag from the policy definitions. However, these workarounds don't address the root cause and rely on configurations that may change in the future, so upgrading to a fixed version is strongly recommended (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related C# vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67288CRITICAL10
  • C#C#
  • Umbraco.Cms
NoNoDec 22, 2025
CVE-2025-68618HIGH7.5
  • C#C#
  • ImageMagick
NoYesDec 30, 2025
CVE-2025-68950MEDIUM6.2
  • C#C#
  • ImageMagick-devel-32bit
NoYesDec 30, 2025
CVE-2025-67291MEDIUM6.1
  • C#C#
  • Piranha
NoNoDec 22, 2025
CVE-2025-67290MEDIUM6.1
  • C#C#
  • Piranha
NoNoDec 22, 2025

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

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