CVE-2021-36749: Druid core Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-9p5g-vg43-mj5r
CVSS 6.5
CWE-668 CWE-863
Published
Advisory Summary

CVE-2021-36749 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Druid core libraries in the Maven ecosystem. The issue involves druid ingestion system authenticated users can read data from other sources than intended. Remediation is available by upgrading affected packages to version 0.22.0.

CVE-2021-36749 at a Glance

CVE Identifier CVE-2021-36749
GHSA Identifier GHSA-9p5g-vg43-mj5r
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Druid core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/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 None (I:N)
Availability None (A:N)

How to Fix CVE-2021-36749

To remediate this vulnerability, upgrade all affected Druid core 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.druid:druid-core fixed: 0.22.0
<dependency>
    <groupId>org.apache.druid</groupId>
    <artifactId>druid-core</artifactId>
    <version>0.22.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.druid

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.druid 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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Druid core, 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 the Druid ingestion system, the InputSource is used for reading data from a certain data source. However, the HTTP InputSource allows authenticated users to read data from other sources than intended, such as the local file system, with the privileges of the Druid server process. This is not an elevation of privilege when users access Druid directly, since Druid also provides the Local InputSource, which allows the same level of access. But it is problematic when users interact with Druid indirectly through an application that allows users to specify the HTTP InputSource, but not the Local InputSource. In this case, users could bypass the application-level restriction by passing a file URL to the HTTP InputSource. This issue was previously mentioned as being fixed in 0.21.0 as per CVE-2021-26920 but was not fixed in 0.21.0 or 0.21.1.

CVE-2021-36749 Affected Druid core Versions

1 component(s)
Fixed Versions:
0.22.0
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.druid:druid-core
Maven
< 0.22.0
0.22.0

References

Frequently Asked Questions

What is CVE-2021-36749?
CVE-2021-36749 is a security vulnerability in Druid core involving Druid ingestion system Authenticated users can read data from other sources than intended under CWE-668: Exposure of Resource to Wrong Sphere.
Which Druid core versions are affected?
Affected versions include releases prior to 0.22.0 across affected packages: org.apache.druid:druid-core.
What version fixes CVE-2021-36749?
Upgrading to 0.22.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is druid-core affected?
Yes, org.apache.druid:druid-core is affected in releases prior to 0.22.0. Upgrade your dependency to 0.22.0 or later.
What is the CVSS score of CVE-2021-36749?
CVE-2021-36749 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-36749?
CVE-2021-36749 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check Maven dependencies for CVE-2021-36749?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.druid'. 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-9p5g-vg43-mj5r",
  "modified" : "2023-09-26T13:13:17Z",
  "published" : "2021-09-27T20:13:25Z",
  "aliases" : [ "CVE-2021-36749" ],
  "summary" : "Druid ingestion system Authenticated users can read data from other sources than intended ",
  "details" : "In the Druid ingestion system, the InputSource is used for reading data from a certain data source. However, the HTTP InputSource allows authenticated users to read data from other sources than intended, such as the local file system, with the privileges of the Druid server process. This is not an elevation of privilege when users access Druid directly, since Druid also provides the Local InputSource, which allows the same level of access. But it is problematic when users interact with Druid indirectly through an application that allows users to specify the HTTP InputSource, but not the Local InputSource. In this case, users could bypass the application-level restriction by passing a file URL to the HTTP InputSource. This issue was previously mentioned as being fixed in 0.21.0 as per CVE-2021-26920 but was not fixed in 0.21.0 or 0.21.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.druid:druid-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.22.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-36749"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-793h-6f7r-6qvm"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r304dfe56a5dfe1b2d9166b24d2c74ad1c6730338b20aef77a00ed2be@%3Cannounce.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc9400a70d0ec5cdb8a3486fc5ddb0b5282961c0b63e764abfbcb9f5d%40%3Cdev.druid.apache.org%3E"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-668", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-27T19:20:40Z",
    "nvd_published_at" : "2021-09-24T10:15:00Z"
  }
}