{"id":"CVE-2024-23635","aliases":["CVE-2024-23635","GHSA-2mrq-w8pv-5pvq"],"related":[],"kind":"vulnerability","state":"published","title":"AntiSamy malicious input can provoke XSS when preserving comments","summary":"AntiSamy is a library for performing fast, configurable cleansing of HTML coming from untrusted sources. Prior to 1.7.5, 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. As a result, certain crafty inputs can result in elements in comment tags being interpreted as executable when using AntiSamy's sanitized output. Patched in AntiSamy 1.7.5 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 1.7.5, 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. As a result, certain crafty inputs can result in elements in comment tags being interpreted as executable when using AntiSamy's sanitized output. Patched in AntiSamy 1.7.5 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. 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.5 and later. This is due to parsing behavior in the [neko-htmlunit](https://github.com/HtmlUnit/htmlunit-neko) dependency, just by updating to a newer version the issue was solved. 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.\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 the parser dependency (neko-htmlunit) and therefore in AntiSamy. 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.5, 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. 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. Parcheado en AntiSamy 1.7.5 y posteriores.","source":"nvd"}],"published":"2024-02-02T16:32:50.470Z","modified":"2026-09-10T03:50:05.305Z","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.5","status":"affected"}],"vendor":"nahsra","product":"antisamy","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.7.5"}],"ecosystem":"Maven","package":"org.owasp.antisamy:antisamy","purl":"pkg:maven/org.owasp.antisamy/antisamy","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.7.5"}],"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-2mrq-w8pv-5pvq","tags":["mitigation","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-23635","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nahsra/antisamy/commit/12a2e31d3855430c119480655c2bbbbb79a66ecd","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nahsra/antisamy/commit/3e84410ed06ab67f0a4cc3183c67528210f4847d","tags":["web"],"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-03-07T18:47:07.109Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-23635","url":"https://www.cve.org/CVERecord?id=CVE-2024-23635","licence":"CVE Terms of Use","modified":"2024-08-01T23:06:25.335Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2mrq-w8pv-5pvq","url":"https://github.com/advisories/GHSA-2mrq-w8pv-5pvq","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:05.305Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-23635","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-23635","licence":"Public domain","modified":"2026-06-17T07:13:16.540Z"}],"updatedAt":"2026-11-25T22:58:36.528Z","epss":{"score":0.00368,"percentile":0.3266,"date":"2026-12-01T12:00:22.000Z"}}