Description
Apache Druid includes the ability to execute user-provided JavaScript code embedded in various types of requests. This functionality is intended for use in high-trust environments, and is disabled by default. However, in Druid 0.20.0 and earlier, it is possible for an authenticated user to send a specially-crafted request that forces Druid to run user-provided JavaScript code for that request, regardless of server configuration. This can be leveraged to execute code on the target machine with the privileges of the Druid server process.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Apache Software Foundation | Apache Druid | 0.20.0 and earlier – ≤ 0.20.0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
Apache Druid 0.20.0 Remote Command Execution
exploit/linux/http/apache_druid_js_rce
GitHub 13 repositories · most starred shown
-
1n7erface/PocList ★ 1,071 · Mar 11, 2021
Alibaba-Nacos-Unauthorized/ApacheDruid-RCE_CVE-2021-25646/MS-Exchange-SSRF-CVE-2021-26885/Oracle-WebLogic-CVE-2021-2109_RCE/RG-CNVD-2021-14536/RJ-SSL-VPN-UltraVires/Redis-Unauthorized-RCE/TDOA-V11.7-…
-
yaunsky/cve-2021-25646 ★ 17 · Feb 3, 2021
Apache Druid 远程代码执行;检测脚本
-
k7pro/CVE-2021-25646-exp ★ 4 · Oct 4, 2024
CVE-2021-25646 Apache Druid 远程代码执行 漏洞检测和利用工具
-
j2ekim/CVE-2021-25646 ★ 4 · Dec 12, 2021
Apache Druid remote code execution vulnerability - Apache Druid 远程代码执行漏洞利用 CVE-2021-25646
-
givemefivw/CVE-2021-25646 ★ 3 · Apr 14, 2021
CVE-2021-25646 Apache Druid 远程代码执行漏洞 Wker脚本
-
Vulnmachines/Apache-Druid-CVE-2021-25646 ★ 3 · Feb 13, 2021
-
lp008/CVE-2021-25646 ★ 2 · Feb 3, 2021
-
tiemio/RCE-PoC-CVE-2021-25646 ★ 1 · May 8, 2025
A proof-of-concept for the CVE-2021-25646, which allows for Command Injection
-
Ormicron/CVE-2021-25646-GUI ★ 1 · Feb 4, 2021
CSharp CVE-2021-25646-GUI
-
gps1949/CVE-2021-25646 ★ 0 · Mar 12, 2025
Apache Druid 远程代码执行复现(CVE-2021-25646)
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- Apache Druid - Remote Code Execution http/cves/2021/CVE-2021-25646.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Maven | org.apache.druid:druid | < 0.20.1 | 0.20.1 | GHSA-wrqf-rrrw-w3mg |
References
- https://lists.apache.org/thread.html/rfda8a3aa6ac06a80c5cbfdeae0fc85f88a5984e32ea05e6dda46f866%40%3Cdev.druid.apache.org%3E
- [oss-security] 20210129 CVE-2021-25646: Authenticated users can override system configurations in their requests which allows them to execute arbitrary code. mailing-list
- [druid-dev] 20210129 Re: [druid-user] Re: CVE-2021-25646: Authenticated users can override system configurations in their requests which allows them to execute arbitrary code. mailing-list
- [druid-dev] 20210129 Re: CVE-2021-25646: Authenticated users can override system configurations in their requests which allows them to execute arbitrary code. mailing-list
- [announce] 20210129 Subject: [CVE-2021-25646] Apache Druid remote code execution vulnerability mailing-list
- [druid-commits] 20210204 [GitHub] [druid] jihoonson merged pull request #10818: Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210204 [GitHub] [druid] jihoonson commented on pull request #10818: Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210204 [GitHub] [druid] jihoonson opened a new pull request #10854: [Backport] Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210204 [druid] branch 0.21.0 updated: Fix CVE-2021-25646 (#10818) (#10854) mailing-list
- [druid-commits] 20210204 [GitHub] [druid] jihoonson merged pull request #10854: [Backport] Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210205 [GitHub] [druid] jihoonson opened a new pull request #10854: [Backport] Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210205 [GitHub] [druid] jihoonson merged pull request #10818: Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210205 [GitHub] [druid] jihoonson commented on pull request #10818: Fix CVE-2021-25646 mailing-list
- [druid-commits] 20210205 [GitHub] [druid] jihoonson merged pull request #10854: [Backport] Fix CVE-2021-25646 mailing-list
- [druid-dev] 20210331 Regarding the 0.21.0 release mailing-list
- http://packetstormsecurity.com/files/162345/Apache-Druid-0.20.0-Remote-Command-Execution.html