CVE-2021-26919: Druid Arbitrary Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-jj4f-p7vv-j4v9
CVSS 8.8
CWE-668
Published
Advisory Summary

CVE-2021-26919 is a HIGH (CVSS 8.8) arbitrary code execution vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Druid libraries in the Maven ecosystem. The issue involves arbitrary code execution in apache druid. Remediation is available by upgrading affected packages to version 0.20.2.

CVE-2021-26919 at a Glance

CVE Identifier CVE-2021-26919
GHSA Identifier GHSA-jj4f-p7vv-j4v9
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Druid
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:H).

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 High (A:H)

How to Fix CVE-2021-26919

To remediate this vulnerability, upgrade all affected Druid 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 fixed: 0.20.2
<dependency>
    <groupId>org.apache.druid</groupId>
    <artifactId>druid</artifactId>
    <version>0.20.2</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-26919, 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 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.20.2), 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, 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

Apache Druid allows users to read data from other database systems using JDBC. This functionality is to allow trusted users with the proper permissions to set up lookups or submit ingestion tasks. The MySQL JDBC driver supports certain properties, which, if left unmitigated, can allow an attacker to execute arbitrary code from a hacker-controlled malicious MySQL server within Druid server processes. This issue was addressed in Apache Druid 0.20.2

CVE-2021-26919 Affected Druid Versions

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

References

NVD — CVE-2021-26919 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-26919
Security Fix Commit FIX COMMIT
https://github.com/apache/druid/commit/48953e3508967f5156c69676432b5d4dd25ea678
Druid Source Repository REPOSITORY
https://github.com/apache/druid
Druid Release RELEASE
https://github.com/apache/druid/releases/tag/druid-0.20.2
lists.apache.org/thread.html/r443e29... WEB
https://lists.apache.org/thread.html/r443e2916c612fbd119839c0fc0729327d6031913a75081adac5b43ad@%3Cdev.druid.apache.org%3E
lists.apache.org/thread.html/r470f8c... WEB
https://lists.apache.org/thread.html/r470f8c92eb5df45f41b3ae609b6315b6c5ff51b3ceb2f09f00ca620f@%3Cdev.druid.apache.org%3E
lists.apache.org/thread.html/r6bc682... WEB
https://lists.apache.org/thread.html/r6bc68264170046448f823d12c17fd1fd875251d97d60869f58709872@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r7a531e... WEB
https://lists.apache.org/thread.html/r7a531ec123570cb7875ff991cf115f99e9ef99a48b3cf3fa4f9d9864@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/ra85fa7... WEB
https://lists.apache.org/thread.html/ra85fa7d31f9bec1148ffd2e4030934927caa8bff89bca9f61f75e697@%3Cdev.druid.apache.org%3E
lists.apache.org/thread.html/rd87451... WEB
https://lists.apache.org/thread.html/rd87451fce34df54796e66321c40d743a68fb4553d72e7f6f0bc62ebd%40%3Cdev.druid.apache.org%3E
lists.apache.org/thread.html/re0910c... WEB
https://lists.apache.org/thread.html/re0910cf4c784897774427fecd95912fb565a6bd06d924a55e70bbbfc@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/re4c5de... WEB
https://lists.apache.org/thread.html/re4c5deb0aae4bace69844d15c9fd1699e907ebfee93bc3926474d110@%3Cdev.druid.apache.org%3E
lists.apache.org/thread.html/rf3ea2a... WEB
https://lists.apache.org/thread.html/rf3ea2a4018e87e6c45d36cf8479af7727dcc276edabd2f7cf59e0c5f@%3Cdev.druid.apache.org%3E

Frequently Asked Questions

What is CVE-2021-26919?
CVE-2021-26919 is a security vulnerability in Druid involving Arbitrary code execution in Apache Druid under CWE-668: Exposure of Resource to Wrong Sphere.
Which Druid versions are affected?
Affected versions include releases prior to 0.20.2 across affected packages: org.apache.druid:druid.
What version fixes CVE-2021-26919?
Upgrading to 0.20.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is druid affected?
Yes, org.apache.druid:druid is affected in releases prior to 0.20.2. Upgrade your dependency to 0.20.2 or later.
What is the CVSS score of CVE-2021-26919?
CVE-2021-26919 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-26919?
CVE-2021-26919 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-26919?
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-jj4f-p7vv-j4v9",
  "modified" : "2022-06-06T18:06:44Z",
  "published" : "2021-06-16T17:51:58Z",
  "aliases" : [ "CVE-2021-26919" ],
  "summary" : "Arbitrary code execution in Apache Druid",
  "details" : "Apache Druid allows users to read data from other database systems using JDBC. This functionality is to allow trusted users with the proper permissions to set up lookups or submit ingestion tasks. The MySQL JDBC driver supports certain properties, which, if left unmitigated, can allow an attacker to execute arbitrary code from a hacker-controlled malicious MySQL server within Druid server processes. This issue was addressed in Apache Druid 0.20.2",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.druid:druid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.20.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-26919"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/druid/commit/48953e3508967f5156c69676432b5d4dd25ea678"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/druid"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/druid/releases/tag/druid-0.20.2"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r443e2916c612fbd119839c0fc0729327d6031913a75081adac5b43ad@%3Cdev.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r470f8c92eb5df45f41b3ae609b6315b6c5ff51b3ceb2f09f00ca620f@%3Cdev.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r6bc68264170046448f823d12c17fd1fd875251d97d60869f58709872@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r7a531ec123570cb7875ff991cf115f99e9ef99a48b3cf3fa4f9d9864@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ra85fa7d31f9bec1148ffd2e4030934927caa8bff89bca9f61f75e697@%3Cdev.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rd87451fce34df54796e66321c40d743a68fb4553d72e7f6f0bc62ebd%40%3Cdev.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/re0910cf4c784897774427fecd95912fb565a6bd06d924a55e70bbbfc@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/re4c5deb0aae4bace69844d15c9fd1699e907ebfee93bc3926474d110@%3Cdev.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf3ea2a4018e87e6c45d36cf8479af7727dcc276edabd2f7cf59e0c5f@%3Cdev.druid.apache.org%3E"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-668" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-31T20:50:36Z",
    "nvd_published_at" : "2021-03-30T08:15:00Z"
  }
}