CVE-2021-25646: Code Injection in Apache Druid
Summary
CVE-2021-25646: Code injection in Apache Druid. Affects org.apache.druid:druid versions < 0.20.1. Fixed in 0.20.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Apache Druid is an open-source distributed data store designed for high-performance analytics. It allows users to execute user-provided JavaScript code embedded in various types of requests. This functionality is typically used in high-trust environments and is disabled by default. However, in versions 0.20.0 and earlier, an authenticated user can exploit a vulnerability that forces Druid to run user-provided JavaScript code, regardless of server configuration. This can lead to the execution of arbitrary code on the target machine with the privileges of the Druid server process.
Vulnerability Detail
The vulnerability (CVE-2021-25646) in Apache Druid allows an authenticated user to send a specially-crafted request that triggers the execution of user-provided JavaScript code. This code injection vulnerability bypasses server configuration and can result in the execution of arbitrary code on the target machine. The impact of this vulnerability is high, as it allows an attacker to gain control over the Druid server process and potentially compromise the entire system. The vulnerability has a CVSS score of 8.8 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How To Fix
Latest published version: 38.0.0 as of 23 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.20.1
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, a temporary workaround is to disable the execution of user-provided JavaScript code in Druid. This can be done by modifying the server configuration to ensure that the functionality is disabled. However, it is important to note that this workaround may impact the functionality of certain features that rely on the execution of JavaScript code. Therefore, it is recommended to upgrade to the latest version as soon as possible.
Conclusion
The code injection vulnerability in Apache Druid (CVE-2021-25646) allows an authenticated user to execute arbitrary code on the target machine. To mitigate this vulnerability, it is crucial to upgrade to Apache Druid version 0.20.1 or later. Alternatively, disabling the execution of user-provided JavaScript code can serve as a temporary workaround. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.druid:druid →
FAQ
Apache Druid is an open-source distributed data store designed for high-performance analytics. It allows users to execute user-provided JavaScript code embedded in various types of requests.
The vulnerability allows an authenticated user to execute arbitrary code on the target machine with the privileges of the Druid server process. This can lead to a complete compromise of the system.
No, the code injection functionality is disabled by default. However, in versions 0.20.0 and earlier, a vulnerability allows an attacker to bypass the server configuration and enable the execution of user-provided JavaScript code.
To fix this vulnerability, it is recommended to upgrade to Apache Druid version 0.20.1 or later. This version includes a fix for the code injection vulnerability.
A temporary workaround is to disable the execution of user-provided JavaScript code in Druid by modifying the server configuration. However, it is recommended to upgrade to the latest version as soon as possible.
Related vulnerabilities
Recent vulnerabilities recorded for org.apache.druid:druid.