CVE-2017-7536: Hibernate validator Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-xxgp-pcfc-3vgc
CVSS 7.0
CWE-470
Published
Advisory Summary

CVE-2017-7536 is a HIGH (CVSS 7.0) privilege escalation vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')) affecting Hibernate validator libraries in the Maven ecosystem. The issue involves privilege escalation in hibernate validator. Remediation is available by upgrading affected packages to version 5.2.5.Final, 5.3.6.Final, 5.4.2.Final.

CVE-2017-7536 at a Glance

CVE Identifier CVE-2017-7536
GHSA Identifier GHSA-xxgp-pcfc-3vgc
Severity HIGH
CVSS v3.1 Base Score 7.0
CWE Classification CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Affected Product Hibernate validator
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2017-7536

To remediate this vulnerability, upgrade all affected Hibernate validator dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.hibernate:hibernate-validator fixed: 5.2.5.Final
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.2.5.Final</version>
</dependency>
org.hibernate:hibernate-validator fixed: 5.3.6.Final
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.3.6.Final</version>
</dependency>
org.hibernate:hibernate-validator fixed: 5.4.2.Final
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.4.2.Final</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.hibernate

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2017-7536, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.hibernate

Analyze the terminal output to locate any version of Hibernate validator in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.5.Final), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.hibernate command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'), where the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. In Hibernate validator, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In Hibernate Validator 5.2.x before 5.2.5.Final, 5.3.x before 5.3.6.Final, and 5.4.x before 5.4.2.Final, it was found that when the security manager's reflective permissions, which allows it to access the private members of the class, are granted to Hibernate Validator, a potential privilege escalation can occur. By allowing the calling code to access those private members without the permission an attacker may be able to validate an invalid instance and access the private member value via ConstraintViolation#getInvalidValue().

CVE-2017-7536 Affected Hibernate validator Versions

3 component(s)
Fixed Versions:
5.2.5.Final5.3.6.Final5.4.2.Final
Product / Package Ecosystem Affected Versions Fixed Version
org.hibernate:hibernate-validator
Maven
≥ 5.2.0
< 5.2.5.Final
5.2.5.Final
org.hibernate:hibernate-validator
Maven
≥ 5.3.0
< 5.3.6.Final
5.3.6.Final
org.hibernate:hibernate-validator
Maven
≥ 5.4.0
< 5.4.2.Final
5.4.2.Final

References

NVD — CVE-2017-7536 NVD
https://nvd.nist.gov/vuln/detail/CVE-2017-7536
Security Fix Commit FIX COMMIT
https://github.com/hibernate/hibernate-validator/commit/0886e89900d343ea20fde5137c9a3086e6da9ac
Security Fix Commit FIX COMMIT
https://github.com/hibernate/hibernate-validator/commit/0778a5c98b817771a645c6f4ba0b28dd8b5437b
lists.apache.org/thread.html/9317fd0... WEB
https://lists.apache.org/thread.html/9317fd092b257a0815434b116a8af8daea6e920b6673f4fd5583d5fe@%3Ccommits.druid.apache.org%3E
Hibernate validator Source Repository REPOSITORY
https://github.com/hibernate/hibernate-validator
bugzilla.redhat.com/show_bug.cgi WEB
https://bugzilla.redhat.com/show_bug.cgi?id=1465573
access.redhat.com/errata/rhsa-2018:38... WEB
https://access.redhat.com/errata/RHSA-2018:3817
access.redhat.com/errata/rhsa-2018:29... WEB
https://access.redhat.com/errata/RHSA-2018:2927
access.redhat.com/errata/rhsa-2018:27... WEB
https://access.redhat.com/errata/RHSA-2018:2743
access.redhat.com/errata/rhsa-2018:27... WEB
https://access.redhat.com/errata/RHSA-2018:2742
access.redhat.com/errata/rhsa-2018:27... WEB
https://access.redhat.com/errata/RHSA-2018:2741
access.redhat.com/errata/rhsa-2018:27... WEB
https://access.redhat.com/errata/RHSA-2018:2740
access.redhat.com/errata/rhsa-2017:34... WEB
https://access.redhat.com/errata/RHSA-2017:3458
access.redhat.com/errata/rhsa-2017:34... WEB
https://access.redhat.com/errata/RHSA-2017:3456
access.redhat.com/errata/rhsa-2017:34... WEB
https://access.redhat.com/errata/RHSA-2017:3455
access.redhat.com/errata/rhsa-2017:34... WEB
https://access.redhat.com/errata/RHSA-2017:3454
access.redhat.com/errata/rhsa-2017:31... WEB
https://access.redhat.com/errata/RHSA-2017:3141
access.redhat.com/errata/rhsa-2017:28... WEB
https://access.redhat.com/errata/RHSA-2017:2811
access.redhat.com/errata/rhsa-2017:28... WEB
https://access.redhat.com/errata/RHSA-2017:2810
access.redhat.com/errata/rhsa-2017:28... WEB
https://access.redhat.com/errata/RHSA-2017:2809
access.redhat.com/errata/rhsa-2017:28... WEB
https://access.redhat.com/errata/RHSA-2017:2808
Hibernate validator Security Information SECURITY
http://www.securityfocus.com/bid/101048
Hibernate validator Security Information SECURITY
http://www.securitytracker.com/id/1039744

Frequently Asked Questions

What is CVE-2017-7536?
CVE-2017-7536 is a security vulnerability in Hibernate validator involving Privilege Escalation in Hibernate Validator under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').
Which Hibernate validator versions are affected?
Affected versions include releases prior to 5.2.5.Final, 5.3.6.Final, 5.4.2.Final across affected packages: org.hibernate:hibernate-validator.
What version fixes CVE-2017-7536?
Upgrading to 5.2.5.Final, 5.3.6.Final, 5.4.2.Final (or the latest patched release for your respective branch) resolves the vulnerability.
Is hibernate-validator affected?
Yes, org.hibernate:hibernate-validator is affected in releases prior to 5.2.5.Final, 5.3.6.Final, 5.4.2.Final. Upgrade your dependency to 5.2.5.Final, 5.3.6.Final, 5.4.2.Final or later.
What is the CVSS score of CVE-2017-7536?
CVE-2017-7536 has a CVSS v3.1 base score of 7.0 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-7536?
CVE-2017-7536 is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') (The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.).
How can I check Maven dependencies for CVE-2017-7536?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.hibernate'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xxgp-pcfc-3vgc",
  "modified" : "2022-07-20T14:21:17Z",
  "published" : "2020-06-15T19:57:48Z",
  "aliases" : [ "CVE-2017-7536" ],
  "summary" : "Privilege Escalation in Hibernate Validator",
  "details" : "In Hibernate Validator 5.2.x before 5.2.5.Final, 5.3.x before 5.3.6.Final, and 5.4.x before 5.4.2.Final, it was found that when the security manager's reflective permissions, which allows it to access the private members of the class, are granted to Hibernate Validator, a potential privilege escalation can occur. By allowing the calling code to access those private members without the permission an attacker may be able to validate an invalid instance and access the private member value via ConstraintViolation#getInvalidValue().",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.hibernate:hibernate-validator"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.2.0"
      }, {
        "fixed" : "5.2.5.Final"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.2.4.Final"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.hibernate:hibernate-validator"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.3.6.Final"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.3.5.Final"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.hibernate:hibernate-validator"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.4.0"
      }, {
        "fixed" : "5.4.2.Final"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.4.1.Final"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-7536"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hibernate/hibernate-validator/commit/0886e89900d343ea20fde5137c9a3086e6da9ac"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hibernate/hibernate-validator/commit/0778a5c98b817771a645c6f4ba0b28dd8b5437b"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/9317fd092b257a0815434b116a8af8daea6e920b6673f4fd5583d5fe@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hibernate/hibernate-validator"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1465573"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3817"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2927"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2743"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2742"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2741"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2740"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:3458"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:3456"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:3455"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:3454"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:3141"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:2811"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:2810"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:2809"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:2808"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/101048"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id/1039744"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-470" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-11T18:50:29Z",
    "nvd_published_at" : "2018-01-10T15:29:00Z"
  }
}