Skip to content
RCE Write-up Intermediate

I Vulnerability introduction

Apache Druid 0.20.0 and earlier allowed an authenticated user to force execution of user-provided JavaScript code regardless of server configuration, leading to remote code execution with the privileges of the Druid process. The report demonstrates this by sending a crafted indexing request that triggers a JavaScript filter to make an outbound HTTP request or write a file.

flystart.medium.com

Published on flystart.medium.com

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.

flystart, on flystart.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An authenticated attacker could execute arbitrary code on the Druid server with the privileges of the Druid process, potentially leading to full compromise.

What the attacker needed

Authenticated access to Druid; target can reach attacker's server or write files

The fix

The vulnerability was fixed in a later version; users should upgrade to a version after 0.20.0.

How it was found

  1. Deploy Apache Druid 0.19.0 using the quickstart script.
  2. Send a crafted indexing request containing a JavaScript filter that makes an outbound HTTP request to a server you control.
  3. Check the access log of your HTTP server to confirm the request was made, indicating code execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Apache Druid is a database tool that can run small JavaScript snippets to filter data. Normally this feature is turned off for safety, but in this version an attacker who can log in could send a request that turns it on just for that request. That let them run their own code on the server, which is called remote code execution.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.