Mutation XSS Vulnerability in libowasp-antisamy-java: Flawed HTML Parsing

libowasp-antisamy-java Updated 02 Oct 2025

Summary

02/02/2024
N/A
No i
Unrated
Not published

DEBIAN-CVE-2024-23635: AntiSamy is a library for performing fast, configurable cleansing of HTML coming from untrusted sources. Affects libowasp-antisamy-java versions 1.5.3+dfsg-1.1 – 1.7.4-1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libowasp-antisamy-java is a library designed for the fast and configurable cleansing of HTML content originating from untrusted sources. It is widely used to sanitize user-generated content to prevent security issues such as XSS (Cross-Site Scripting). The library allows users to define policies for sanitization, making it flexible and adaptable to various use cases. However, prior to version 1.7.5, it contained a vulnerability that could lead to mutation XSS attacks when specific configurations were enabled.

Vulnerability Detail

The vulnerability arises from a flaw in the HTML parsing mechanism of AntiSamy when the 'preserveComments' directive is enabled in the policy file. This flaw allows certain crafted inputs to be processed in a way that elements within comment tags can be executed, leading to potential XSS attacks. The vulnerability is identified as CVE-2024-23635 and affects versions prior to 1.7.5. If exploited, it could allow attackers to execute malicious scripts in the context of the user's browser, compromising user data and application integrity.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If updating the package is not immediately feasible, consider disabling the 'preserveComments' directive in your policy file to mitigate the risk of exploitation. This can be done by modifying your AntiSamy policy configuration to set 'preserveComments' to false.

Conclusion

The libowasp-antisamy-java library is a vital tool for sanitizing HTML content, but it is crucial to be aware of the mutation XSS vulnerability (CVE-2024-23635) present in versions prior to 1.7.5. Updating to the latest version and modifying policy configurations are essential steps to ensure the security of applications using this library.

See every vulnerability recorded for libowasp-antisamy-java →

Share this vulnerability

FAQ

Mutation XSS is a type of cross-site scripting vulnerability that occurs when an attacker is able to inject malicious scripts into a web application, which are then executed in the context of a user's browser.

You can check if your application is affected by using the Vulert playground at Vulert Scanner. It allows you to monitor and alert for open-source vulnerabilities without requiring installation.

The risks include unauthorized access to user data, session hijacking, and the potential for attackers to perform actions on behalf of users, leading to data breaches and loss of trust.

Yes, there are alternative libraries and methods for sanitizing HTML, such as DOMPurify or using built-in browser APIs, but they may have different features and levels of security.

If an immediate update is not possible, ensure that the 'preserveComments' directive is disabled in your policy file to reduce the risk of exploitation until you can apply the patch.

Related vulnerabilities

Recent vulnerabilities recorded for libowasp-antisamy-java.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback