Mutation XSS Vulnerability in libowasp-antisamy-java: Potential Risk in HTML Sanitization

libowasp-antisamy-java Updated 03 Oct 2025

Summary

02/02/2024
N/A
No i
Medium
6.1

UBUNTU-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. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 inputs in web applications, ensuring that potentially harmful scripts are removed before rendering. However, prior to version 1.7.5, the library had a vulnerability that could lead to mutation cross-site scripting (mXSS) attacks when specific configurations were enabled.

Vulnerability Detail

The vulnerability arises from flawed parsing of HTML when the 'preserveComments' directive is enabled in the policy file. This flaw allows malicious inputs to be processed in such a way that elements within comment tags can be executed, leading to potential security breaches. The issue is particularly concerning as it can be exploited without user interaction, making it a significant risk for applications relying on this library for sanitization.

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 immediate updating is not feasible, consider disabling the 'preserveComments' directive in your policy file to mitigate the risk of exploitation. This can be done by modifying the policy file as follows:

<policy> ``` <preserveComments>false</preserveComments> ``` </policy>

Conclusion

The libowasp-antisamy-java library has a significant vulnerability that can lead to mutation XSS attacks if not addressed. Updating to the patched version 1.7.5 or later is crucial for maintaining application security. Users are encouraged to review their configurations and consider using tools like Vulert for ongoing vulnerability monitoring.

See every vulnerability recorded for libowasp-antisamy-java →

Share this vulnerability

FAQ

Mutation XSS (mXSS) is a type of cross-site scripting attack where malicious scripts are executed due to flaws in the way HTML is sanitized, particularly when comments are preserved.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.

Exploitation of this vulnerability can lead to unauthorized script execution, data theft, and compromise of user sessions, posing significant risks to application security.

Yes, the vulnerability has been patched in version 1.7.5 of libowasp-antisamy-java. It is recommended to update to this version or later.

If an immediate update is not possible, disable the 'preserveComments' directive in your policy file as a temporary workaround to reduce the risk.

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