The SafeHtml annotation in Hibernate-Validator does not properly guard against XSS attacks

Description

A vulnerability was found in Hibernate-Validator. The SafeHtml validator annotation fails to properly sanitize payloads consisting of potentially malicious code in HTML comments and instructions. This vulnerability can result in an XSS attack.

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Source code
Browse source ↗
Published (advisory)
2020-01-08 17:01:52 UTC
Updated
2025-09-12 20:12:10 UTC
GitHub reviewed
2020-01-08 17:00:14 UTC
NVD published
2019-11-08

EPSS Score

Score Percentile
1.67% 81.68%

CVSS Scores

Base score Version Severity Vector
6.5 3.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.

Identifiers

CWEs

CWE id Name
CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Credits

  • SunBK201 (analyst)
  • poc-effectiveness (analyst)

Affected packages (4)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
maven org.hibernate.validator:hibernate-validator >= 6.1.0.Alpha1, < 6.1.0.Alpha6 6.1.0.Alpha6
maven org.hibernate.validator:hibernate-validator >= 6.0.0.Alpha1, <= 6.0.17.Final 6.0.18.Final
maven org.hibernate:hibernate-validator >= 6.1.0.Alpha1, < 6.1.0.Alpha6 6.1.0.Alpha6
maven org.hibernate:hibernate-validator >= 6.0.0.Alpha1, <= 6.0.17.Final 6.0.18.Final

References

cvelogic Threat Intelligence