Loading...
Skip to main content

CVE-2023-51652 — Vulnerability in OWASP.AntiSamy — CVE Details

MEDIUM

OWASP.AntiSamy mXSS when preserving comments

Published January 2, 2024Updated February 16, 2024Source: osv

Summary

# Impact There is a potential for a mutation XSS (mXSS) vulnerability in AntiSamy caused by flawed parsing of the HTML being sanitized. To be subject to this vulnerability the `preserveComments` directive must be enabled in your policy file and also allow for certain tags at the same time. As a result, certain crafty inputs can result in elements in comment tags being interpreted as executable when using AntiSamy's sanitized output. # Patches Patched in OWASP AntiSamy .NET 1.2.0 and later. See important remediation details in the reference given below. # Workarounds If you cannot upgrade to a fixed version of the library, the following mitigation can be applied until you can upgrade: Manually edit your AntiSamy policy file (e.g., antisamy.xml) by deleting the `preserveComments` directive or setting its value to `false`, if present. Also it would be useful to make AntiSamy remove the `noscript` tag by adding this in your tag definitions under the `<tagrules>` node (or deleting it entirely if present): ```xml <tag name="noscript" action="remove"/> ``` As the previously mentioned policy settings are preconditions for the mXSS attack to work, changing them as recommended should be sufficient to protect you against this vulnerability when using a vulnerable version of this library. However, the existing bug would still be present in AntiSamy or its parser dependency (HtmlAgilityPack). The safety of this workaround relies on configurations that may change in the future and don't address the root cause of the vulnerability. As such, it is strongly recommended to upgrade to a fixed version of AntiSamy. # For more information If you have any questions or comments about this advisory: Email one of the project co-leaders, listed on the [OWASP AntiSamy project](https://owasp.org/www-project-antisamy/) page, under "Leaders".

Advisory Timeline

  • First published January 2, 2024 (1014 days ago).
  • Last revised February 16, 2024 — 45 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update OWASP.AntiSamy to 1.2.0 or later
dotnet add package OWASP.AntiSamy --version 1.2.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: nuget (1).

PackageEcosystemAffectedFixed In
OWASP.AntiSamy
nuget
1.0.0, 1.0.1, 1.0.2, 1.0.3 (+2 more)1.2.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Frequently Asked Questions

What is CVE-2023-51652?
OWASP.AntiSamy mXSS when preserving comments This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
How do I check if my project is affected by CVE-2023-51652?
CVE-2023-51652 affects OWASP.AntiSamy. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-51652 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.1

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-8x6f-956f-q43w

Related CVEs

  • CVE-2026-106111
    MEDIUM

    ImageSharp: EXR ZIP decoder can expose stale allocator data after a short inflate

  • CVE-2026-65829
    MEDIUM

    MPXJ: Potential Path Traversal Vulnerability in Primavera P3 PRX and SureTrak STX readers

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies