Skip to content
RCE Advisory Advanced CVE-2023-52251CVE-2024-32030

GHSL-2023-229_GHSL-2023-230: Remote code execution (RCE) in UI for Apache Kafka - CVE-2023-52251, CVE-2024-32030

Kafka UI is affected by two remote code execution vulnerabilities: one allows execution of arbitrary Groovy scripts via message filtering, and the other allows RCE through unsafe deserialization when connecting to a malicious JMX server. An attacker could execute arbitrary code on the server, especially since authentication is not enabled by default.

Michael Stepankin Follow

Originally disclosed on GitHub Security Lab

Kafka UI is affected by two remote code execution vulnerabilities. The first vulnerability in the message filtering component leads to execution of arbitrary unsandboxed groovy script.

artsploit, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The message filtering feature executes user-supplied Groovy scripts without sandboxing, and the JMX metrics collection deserializes untrusted data from remote servers without validation.

Impact

Both vulnerabilities could lead to remote code execution, and the first is particularly dangerous because authentication is not enabled by default; the second requires dynamic.config.enabled or access to the Kafka cluster.

What the attacker needed

Kafka UI running with default settings; Access to the web interface; For issue 2: dynamic.config.enabled=true or Kafka cluster…

The fix

The vulnerabilities were fixed in version 0.7.2 of Kafka UI.

How it was found

  1. Run Kafka UI with default settings and connect it to a Kafka cluster.
  2. Navigate to cluster->Topics->Messages and create a new filter with a Groovy script.
  3. Send a GET request to the messages endpoint with the Groovy script as a query parameter.
  4. The script is evaluated on the server, creating a file.
  5. For the second issue, run Kafka UI with dynamic.config.enabled=true and start a Kafka broker.
  6. Set up a malicious JMX listener using ysoserial and add the cluster in Kafka UI with the JMX port.

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 report has not been written yet. The Original tab links to the source.

Kafka UI is a web tool for managing Kafka, a system for handling data streams. Two bugs let an attacker run their own commands on the server: one by typing a special script into a message filter, and another by tricking Kafka UI into connecting to a fake monitoring server that sends back malicious data. This is serious because the tool often has no login required.

What is RCE?

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

More by Michael Stepankin

View all

16 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.