CVE-2024-23635
AntiSamy malicious input can provoke XSS when preserving comments
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.1
AntiSamy malicious input can provoke XSS when preserving comments
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.
- Record
CVE-2024-23635- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2024-0472
6.1
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.
- Record
EUVD-2024-0472- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-2mrq-w8pv-5pvq
6.1
Malicious input can provoke XSS when preserving comments
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. 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 AntiSamy 1.7.5 and later. This is due to parsing behavior in the neko-htmlunit dependency, just by updating to a newer version the issue was solved. 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.
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 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.
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 page, under "Leaders".
- Record
GHSA-2mrq-w8pv-5pvq- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
6.1
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.
- Record
CVE-2024-23635- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
6.1
AntiSamy malicious input can provoke XSS when preserving comments
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.
- Record
CVE-2024-23635- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-23635
6.1
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.
- Record
DEBIAN-CVE-2024-23635- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVGHSA-2mrq-w8pv-5pvq
6.1
Malicious input can provoke XSS when preserving comments
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. 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 AntiSamy 1.7.5 and later. This is due to parsing behavior in the neko-htmlunit dependency, just by updating to a newer version the issue was solved. 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.
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 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.
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 page, under "Leaders".
- Record
GHSA-2mrq-w8pv-5pvq- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-23635
6.1
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.
- Record
UBUNTU-CVE-2024-23635- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
org.owasp.antisamy:antisamyMaven |
through 1.7.4 | 1.7.5 |
libowasp-antisamy-javaDebian:12 |
All versions, plus listed versions 1.5.3+dfsg-1.11.7.4-11.7.8-1 |
None known |
libowasp-antisamy-javaDebian:13 |
All versions, plus listed versions 1.7.4-11.7.8-1 |
None known |
libowasp-antisamy-javaDebian:14 |
before 1.7.8-1, plus listed versions 1.7.4-1 |
1.7.8-1 |
org.owasp.antisamy:antisamyMaven |
before 1.7.5, plus listed versions 1.4.21.4.31.4.41.4.51.5 Show 27 moreShow less1.5.11.5.101.5.111.5.121.5.131.5.21.5.31.5.51.5.61.5.71.5.81.5.91.6.01.6.11.6.21.6.31.6.41.6.51.6.61.6.6.11.6.71.6.81.7.01.7.11.7.21.7.31.7.4 |
1.7.5 |
libowasp-antisamy-javaUbuntu:16.04:LTS |
All versions, plus listed versions 1.5.3+dfsg-1 |
None known |
libowasp-antisamy-javaUbuntu:18.04:LTS |
All versions, plus listed versions 1.5.3+dfsg-1 |
None known |
libowasp-antisamy-javaUbuntu:20.04:LTS |
All versions, plus listed versions 1.5.3+dfsg-1 |
None known |
libowasp-antisamy-javaUbuntu:22.04:LTS |
All versions, plus listed versions 1.5.3+dfsg-1.1 |
None known |
libowasp-antisamy-javaUbuntu:24.04:LTS |
All versions, plus listed versions 1.5.3+dfsg-1.11.7.4-1 |
None known |
libowasp-antisamy-javaUbuntu:25.10 |
All versions, plus listed versions 1.7.4-1 |
None known |
libowasp-antisamy-javaUbuntu:26.10 |
All versions, plus listed versions 1.7.4-1 |
None known |
libowasp-antisamy-javaUbuntu:26.04:LTS |
All versions, plus listed versions 1.7.4-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-23635 is a medium vulnerability (CVSS 6.1) in Antisamy Project Antisamy, published February 2, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.37%, the 30th percentile. Fixed in org.owasp.antisamy:antisamy 1.7.5.
References
github.com/nahsra/antisamy/security/advisories/GHSA-2mrq-w8pv-5pvq
github.com/nahsra/antisamy/commit/12a2e31d3855430c119480655c2bbbbb79a66ecd
github.com/nahsra/antisamy/commit/3e84410ed06ab67f0a4cc3183c67528210f4847d
nvd.nist.gov/vuln/detail/CVE-2024-23635
github.com/advisories/GHSA-2mrq-w8pv-5pvq
github.com/CVEProject/cvelistV5/tree/main/cves/2024/23xxx/CVE-2024-23635.json