{"answers":{"affected":"2 open source packages ship an affected version, including OWASP.AntiSamy. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-51652 in the wild and no public exploit code.","fix":"Upgrade OWASP.AntiSamy to 1.2.0 or later.","what":"CVE-2023-51652 is a medium-severity cross-site scripting vulnerability in spassarop antisamy-dotnet, published on 2 Jan 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2023-51652 and fix it if it is affected.\n\nWhat it is: CVE-2023-51652 is a medium-severity cross-site scripting vulnerability in spassarop antisamy-dotnet, published on 2 Jan 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2023-51652 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- OWASP.AntiSamy (NuGet): affected all versions; fixed in 1.2.0\n- OWASP.AntiSamy (NuGet): affected all versions; fixed in 1.2.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-51652/ (Markdown: https://insights.sbomify.com/CVE-2023-51652/index.md)","id":"CVE-2023-51652","markdown":"https://insights.sbomify.com/CVE-2023-51652/index.md","name":"CVE-2023-51652","record":{"aliases":["GHSA-8x6f-956f-q43w"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"HTML sanitization library","requires_auth":"none","summary":"Attackers can execute arbitrary scripts via mutation XSS in OWASP AntiSamy .NET when comment preservation is enabled.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"owasp_antisamy_.net","vendor":"spassarop"}],"cvss":{"score":6.1,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"OWASP AntiSamy .NET is a library for performing cleansing of HTML coming from untrusted sources. Prior to version 1.2.0, there is a potential for a mutation cross-site scripting (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. This is patched in OWASP AntiSamy .NET 1.2.0 and later. See important remediation details in the reference given below. As a workaround, manually edit the 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 a line described in the GitHub Security Advisory to the tag definitions under the `\u003ctagrules\u003e` node, or deleting it entirely if present. 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.","ecosystems":["NuGet"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"OWASP.AntiSamy mXSS when preserving comments","id":"CVE-2023-51652","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"NuGet","product":null,"products":[],"type":"xss","year":"2023"},"n_packages":2,"n_references":3,"next":{"headline":"Hertzbeat JMX JNDI RCE","id":"CVE-2023-51653"},"packages":[{"ecosystem":"NuGet","fixed":["1.2.0"],"introduced":["0"],"last_affected":[],"package":"OWASP.AntiSamy","purl":null,"source":"GHSA-8x6f-956f-q43w"},{"ecosystem":"NuGet","fixed":["1.2.0"],"introduced":["0"],"last_affected":[],"package":"OWASP.AntiSamy","purl":"pkg:nuget/OWASP.AntiSamy","source":"GHSA-8x6f-956f-q43w"}],"prev":{"headline":"Potential URI resolution path traversal in the AWS SDK for PHP","id":"CVE-2023-51651"},"products":["antisamy-dotnet"],"published":"2024-01-02","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-04-17","vendors":["spassarop"]},"summary":"Attackers can execute arbitrary scripts via mutation XSS in OWASP AntiSamy .NET when comment preservation is enabled.","url":"https://insights.sbomify.com/CVE-2023-51652/"}