XSS Vulnerability in Hibernate Validator: Unsafe HTML Comment Handling

libhibernate-validator-java Updated 02 Oct 2025

Summary

08/11/2019
N/A
No i
Medium
6.1

CVE-2019-10219: A vulnerability was found in Hibernate-Validator. Affects libhibernate-validator-java across 5 version ranges.

< 0c0a68e6f6a8bad0852d06e19313338722ada95b < 20d729548511ac5cff6fd459f93de137195420fe < 124b7dd6d9a4ad24d4d49f74701f05a13e56cee < 124b7dd6d9a4ad24d4d49f74701f05a13e56ceee >= bf5e41160a6e5e4caf382f7533deae1258523e68, < 2b9eb103d1668cf5eac22fe85bdad7513681d9e3

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

Hibernate Validator is a widely used library in Java applications that provides a framework for validating JavaBeans. It is part of the Hibernate ORM ecosystem and is essential for ensuring data integrity and security in applications. The library offers various validation annotations, including SafeHtml, which is intended to sanitize HTML input. However, a critical vulnerability has been identified that compromises the effectiveness of this sanitization, specifically in handling HTML comments and instructions.

Vulnerability Detail

A vulnerability was discovered in Hibernate Validator where the SafeHtml validator annotation fails to adequately sanitize payloads containing potentially malicious code embedded within HTML comments and instructions. This oversight can lead to Cross-Site Scripting (XSS) attacks, allowing attackers to inject malicious scripts into web pages viewed by users. The vulnerability affects multiple versions of the libhibernate-validator-java package across different Debian ecosystems, making it a significant concern for applications relying on this library.

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

As a temporary workaround, developers can implement additional input sanitization measures in their applications to filter out potentially harmful HTML comments and instructions before processing user inputs. This can be done using libraries such as OWASP Java HTML Sanitizer or similar tools that provide robust sanitization capabilities.

Conclusion

The vulnerability in Hibernate Validator poses a significant risk due to its potential for XSS attacks through improper sanitization of HTML comments. It is crucial for developers using this library to update their packages promptly and consider implementing additional input sanitization measures to mitigate risks.

See every vulnerability recorded for libhibernate-validator-java →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 6.1, indicating a medium severity level.

All versions of the libhibernate-validator-java package across Debian ecosystems are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By utilizing the Vulert playground, you can check if your application is affected by this vulnerability without any signup.

If exploited, this vulnerability can lead to XSS attacks, allowing attackers to execute malicious scripts in the context of the user's browser, potentially compromising user data and application integrity.

Yes, a permanent fix is available by updating the libhibernate-validator-java package to a version that addresses this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for libhibernate-validator-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