Mutation XSS Vulnerability in libowasp-antisamy-java: A Security Concern

libowasp-antisamy-java Updated 02 Oct 2025

Summary

09/10/2023
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2023-43643: AntiSamy is a library for performing fast, configurable cleansing of HTML coming from untrusted sources. Affects libowasp-antisamy-java versions < 1.7.4-1. Fixed in 1.7.4-1. 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 Your last release was probably never penetration tested 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 Java library designed for the secure cleansing of HTML content originating from untrusted sources. It provides configurable options to sanitize HTML, ensuring that potentially harmful scripts are removed before rendering. This library is widely used in applications that require user-generated content to be displayed safely. However, prior to version 1.7.4, it was found to be vulnerable to a mutation XSS (mXSS) attack due to improper parsing of HTML when the 'preserveComments' directive is enabled.

Vulnerability Detail

The vulnerability arises from the flawed parsing mechanism in AntiSamy, which can lead to a mutation XSS (mXSS) attack. When the 'preserveComments' directive is enabled in the policy file, certain HTML tags can be allowed, which may allow malicious inputs to be executed as scripts when the sanitized output is rendered. This can lead to unauthorized actions being performed on behalf of users, potentially compromising sensitive data and application integrity.

How To Fix

Minimum fixed version

1.7.4-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libowasp-antisamy-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can disable the 'preserveComments' directive in your policy file to mitigate the risk of this vulnerability until you can update to the patched version. Ensure that your policy file does not allow any tags that could be exploited.

Conclusion

The mutation XSS vulnerability in libowasp-antisamy-java poses a significant risk to applications that utilize this library for HTML sanitization. It is crucial to update to version 1.7.4 or later to mitigate this risk. Additionally, employing workarounds can provide temporary relief until the update is applied.

See every vulnerability recorded for libowasp-antisamy-java →

Share this vulnerability

FAQ

Mutation XSS is a type of cross-site scripting attack where malicious scripts are injected into a web application through the manipulation of the Document Object Model (DOM).

You can check if your application is affected by using tools like Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your manifest file.

If exploited, this vulnerability can allow attackers to execute arbitrary scripts in the context of the user's session, potentially leading to data theft, session hijacking, or other malicious actions.

Yes, you can temporarily disable the 'preserveComments' directive in your policy file as a workaround until you can apply the necessary updates.

Related vulnerabilities

Recent vulnerabilities recorded for libowasp-antisamy-java.

How To Fix

Minimum fixed version

1.7.4-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libowasp-antisamy-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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