Skip to content
RCE Write-up Advanced

How to Get Remote Code Execution in Kafka UI

Kafka UI allowed remote code execution through three distinct vulnerabilities: Groovy script injection in message filters, JMX deserialization via malicious broker connections, and JNDI injection in SASL JAAS configuration. An attacker could execute arbitrary commands on the server, potentially leading to full system compromise.

github.blog

Published on github.blog

Michael Stepankin·@artsploit

Michael Stepankin, on github.blog

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

Root cause

The application allowed user-controlled input to be evaluated as code or used in dangerous Java features (Groovy scripting, JMX deserialization, JNDI lookup) without proper restrictions.

Impact

An attacker could execute arbitrary commands on the Kafka UI server, potentially leading to full system compromise and access to internal networks.

What the attacker needed

Kafka UI instance accessible; dynamic.config.enabled for JMX and JNDI exploits; at least one topic with messages for Groovy exploit

The fix

The vulnerabilities were fixed in version 0.7.2 by updating dependencies and restricting dangerous features.

How it was found

  1. Navigate to a cluster, select a topic, and open the Messages tab.
  2. Create a new filter with a Groovy script that spawns a reverse shell.
  3. Submit the filter, which sends a GET request to the server with the script as a query parameter.
  4. The server executes the Groovy script, resulting in remote 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.

Kafka UI is a web tool for managing Kafka clusters. The report shows three ways an attacker could run their own commands on the server: by abusing a feature that runs Groovy scripts, by connecting to a malicious JMX server, and by injecting a JNDI lookup in a configuration setting. This means an attacker could take control of the server.

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.