{"id":"CVE-2023-43643","aliases":["CVE-2023-43643","GHSA-pcf2-gh6g-h5r2"],"related":[],"kind":"vulnerability","state":"published","title":"mXSS in AntiSamy","summary":"AntiSamy is a library for performing fast, configurable cleansing of HTML coming from untrusted sources. Prior to version 1.7.4, 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. This issue has been patched in AntiSamy 1.7.4 and later.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"AntiSamy is a library for performing fast, configurable cleansing of HTML coming from untrusted sources. Prior to version 1.7.4, 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. This issue has been patched in AntiSamy 1.7.4 and later.","source":"cvelist"},{"lang":"en","text":"# Impact\n\nThere 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.\n\n# Patches\n\nPatched in AntiSamy 1.7.4 and later. See important remediation details in the reference given below.\n\n# Workarounds\n\nIf 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):\n```xml\n<tag name=\"noscript\" action=\"remove\"/>\n```\n\nAs 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 (neko-htmlunit). 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.\n\n# For more information\n\nIf you have any questions or comments about this advisory:\n\nEmail one of the project co-leaders, listed on the [OWASP AntiSamy project](https://owasp.org/www-project-antisamy/) page, under \"Leaders\".","format":"markdown","source":"ghsa"},{"lang":"es","text":"AntiSamy es una librería para realizar una limpieza rápida y configurable de HTML proveniente de fuentes no confiables. Antes de la versión 1.7.4, existe la posibilidad de que se produzca una vulnerabilidad de mutación XSS (mXSS) en AntiSamy causada por un análisis defectuoso del HTML que se está sanitizando. Para estar sujeto a esta vulnerabilidad, la directiva `preserveComments` debe estar habilitada en su archivo de política y también permitir ciertas etiquetas al mismo tiempo. Como resultado, ciertas entradas astutas pueden dar lugar a que los elementos de las etiquetas de comentarios se interpreten como ejecutables cuando se utiliza la salida sanitizada de AntiSamy. Este problema se solucionó en AntiSamy 1.7.4 y versiones posteriores.","source":"nvd"}],"published":"2023-10-09T00:42:27.000Z","modified":"2026-09-10T03:50:04.035Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"<= 1.7.3","status":"affected"}],"vendor":"nahsra","product":"antisamy","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.7.4"}],"ecosystem":"Maven","package":"org.owasp.antisamy:antisamy","purl":"pkg:maven/org.owasp.antisamy/antisamy","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.7.4"}],"vendor":"antisamy_project","product":"antisamy","cpe":"cpe:2.3:a:antisamy_project:antisamy:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nahsra/antisamy/security/advisories/GHSA-pcf2-gh6g-h5r2","tags":["exploit","mitigation","product","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nahsra/antisamy/releases/tag/v1.7.4","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-43643","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nahsra/antisamy","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-19T13:15:16.197Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-43643","url":"https://www.cve.org/CVERecord?id=CVE-2023-43643","licence":"CVE Terms of Use","modified":"2024-09-19T13:57:25.721Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pcf2-gh6g-h5r2","url":"https://github.com/advisories/GHSA-pcf2-gh6g-h5r2","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:04.035Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-43643","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-43643","licence":"Public domain","modified":"2026-06-17T06:26:08.363Z"}],"updatedAt":"2026-11-25T22:58:28.537Z","epss":{"score":0.00541,"percentile":0.46925,"date":"2026-12-02T12:00:21.000Z"}}