HTML Injection and XSS Vulnerability in Hibernate Validator - CVE-2023-1932

libhibernate-validator-java Updated 02 Oct 2025

Summary

07/11/2024
N/A
No i
Unrated
Not published

CVE-2023-1932: A flaw was found in hibernate-validator's 'isValid' method in the org.hibernate.validator.internal.constraintvalidators.hv.SafeHtmlValidator class, which can be bypassed by omitting the tag ending in a less-than characte... Affects libhibernate-validator-java versions < a883dcd11d7f9d8bdd8a2069a54cddd9213051c6. 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

Hibernate Validator is a popular library used in Java applications for validating user input. It provides a set of annotations and a validation framework that helps ensure data integrity and security. The library is widely utilized in various Java-based frameworks, including Spring. However, a recent vulnerability has been identified in the 'isValid' method of the SafeHtmlValidator class, which could allow attackers to inject malicious HTML or execute Cross-Site Scripting (XSS) attacks.

Vulnerability Detail

CVE-2023-1932 is a security flaw in the Hibernate Validator's SafeHtmlValidator class. The vulnerability arises when the 'isValid' method fails to properly handle HTML tags that end with a less-than character. This oversight can lead to browsers rendering invalid HTML, which may allow attackers to inject malicious scripts or HTML content into web applications. The potential ramifications include unauthorized access to user data, session hijacking, and other forms of XSS attacks, compromising the security of affected applications.

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 on user inputs before they are processed by the Hibernate Validator. This can be done by using libraries such as OWASP Java HTML Sanitizer to clean and validate HTML content before it is rendered in the application.

Conclusion

CVE-2023-1932 represents a significant security risk for applications using Hibernate Validator. It is crucial for developers to update their packages to the latest version to protect against potential HTML injection and XSS attacks. Implementing input sanitization can serve as a temporary measure while updates are being arranged.

See every vulnerability recorded for libhibernate-validator-java →

Share this vulnerability

FAQ

CVE-2023-1932 is a vulnerability in the Hibernate Validator that allows for HTML injection and XSS attacks due to improper handling of HTML tags.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The vulnerability can lead to unauthorized access to user data, session hijacking, and other forms of XSS attacks, compromising application security.

Yes, updating to the latest version of 'libhibernate-validator-java' will address the vulnerability.

If immediate updates are not possible, implement input sanitization as a temporary workaround to mitigate the risk of HTML injection.

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