Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') Affecting owasp.antisamy package, versions [,1.2.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.07% (34th 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 Learn

Learn about Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-DOTNET-OWASPANTISAMY-6143125
  • published3 Jan 2024
  • disclosed2 Jan 2024
  • creditDavid K

Introduced: 2 Jan 2024

CVE-2023-51652  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade OWASP.AntiSamy to version 1.2.0 or higher.

Overview

OWASP.AntiSamy is a library for performing fast, configurable cleansing of HTML coming from untrusted sources.

Affected versions of this package are vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') due to flawed parsing of the HTML being sanitized. An attacker can manipulate its output to execute scripts by crafting inputs that exploit the parsing process.

Note:

This is only exploitable if the preserveComments directive is set to true and specific tags are allowed in the policy file.

Workaround

This vulnerability can be mitigated by manually editing the AntiSamy policy file to either remove the preserveComments directive or set its value to false, and ensuring the noscript tag is removed or not allowed by the policy.

References

CVSS Scores

version 3.1