Vulnerabilities in pkg:maven/org.apache.ranger/ranger-hive-plugin

PACKAGE
Advisory Identifier: GHSA-vjr2-wpfh-5r9p
Advisory Summary

CVE-2021-40331 is a HIGH (CVSS 8.1) apache ranger hive plugin missing vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Ranger hive plugin libraries in the Maven ecosystem. The issue involves apache ranger hive plugin missing permissions check. Remediation is available by upgrading affected packages to version 2.4.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.ranger/ranger-hive-plugin

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.ranger/ranger-hive-plugin. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vjr2-wpfh-5r9p CVE-2021-40331 HIGH Apache Ranger Hive Plugin missing permissions check

CVE-2021-40331 at a Glance

CVE Identifier CVE-2021-40331
GHSA Identifier GHSA-vjr2-wpfh-5r9p
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Ranger hive plugin
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2021-40331

To remediate this vulnerability, upgrade all affected Ranger hive plugin 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.apache.ranger:ranger-hive-plugin fixed: 2.4.0
<dependency>
    <groupId>org.apache.ranger</groupId>
    <artifactId>ranger-hive-plugin</artifactId>
    <version>2.4.0</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.apache.ranger

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.apache.ranger

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

Note: The mvn dependency:tree -Dincludes=org.apache.ranger 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-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Ranger hive plugin, 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

An Incorrect Permission Assignment for Critical Resource vulnerability was found in the Apache Ranger Hive Plugin. Any user with SELECT privilege on a database can alter the ownership of the table in Hive when Apache Ranger Hive Plugin is enabled This issue affects Apache Ranger Hive Plugin: from 2.0.0 through 2.3.0. Users are recommended to upgrade to version 2.4.0 or later.

CVE-2021-40331 Affected Ranger hive plugin Versions

1 component(s)
Fixed Versions:
2.4.0
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.ranger:ranger-hive-plugin
Maven
≥ 2.0.0
< 2.4.0
2.4.0

References

Frequently Asked Questions

What is CVE-2021-40331?
CVE-2021-40331 is a security vulnerability in Ranger hive plugin involving Apache Ranger Hive Plugin missing permissions check under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Ranger hive plugin versions are affected?
Affected versions include releases prior to 2.4.0 across affected packages: org.apache.ranger:ranger-hive-plugin.
What version fixes CVE-2021-40331?
Upgrading to 2.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ranger-hive-plugin affected?
Yes, org.apache.ranger:ranger-hive-plugin is affected in releases prior to 2.4.0. Upgrade your dependency to 2.4.0 or later.
What is the CVSS score of CVE-2021-40331?
CVE-2021-40331 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2021-40331?
CVE-2021-40331 is classified under CWE-732: Incorrect Permission Assignment for Critical Resource (The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.).
How can I check Maven dependencies for CVE-2021-40331?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.ranger'. 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-vjr2-wpfh-5r9p",
  "modified" : "2023-05-11T20:56:09Z",
  "published" : "2023-05-05T09:30:15Z",
  "aliases" : [ "CVE-2021-40331" ],
  "summary" : "Apache Ranger Hive Plugin missing permissions check",
  "details" : "An Incorrect Permission Assignment for Critical Resource vulnerability was found in the Apache Ranger Hive Plugin. Any user with SELECT privilege on a database can alter the ownership of the table in Hive when Apache Ranger Hive Plugin is enabled\nThis issue affects Apache Ranger Hive Plugin: from 2.0.0 through 2.3.0. Users are recommended to upgrade to version 2.4.0 or later.\n\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.ranger:ranger-hive-plugin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-40331"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/ranger/commit/7dec3015ec82b69ba8f724410f12dfce2480cccd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/ranger/commit/9115a20d524ba9173ce5db3e270c385d58d8aeab"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/ranger"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/RANGER-3357"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/RANGER-3474"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/s68yls6cnkdmzn1k4hqt50vs6wjvt2rn"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-732" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-05-05T22:53:57Z",
    "nvd_published_at" : "2023-05-05T08:15:08Z"
  }
}