Skip to content
RCE Write-up Advanced

Pwning an outdated Kibana with not so sad vulnerabilities

An outdated Kibana instance was vulnerable to a local file inclusion and a prototype pollution, but neither was directly exploitable because the required file upload feature and the Canvas plugin were missing. The authors chained the two issues by using the file inclusion to load a plugin manager file that reads command-line arguments from a prototype property, allowing them to install a malicious plugin and achieve remote code execution.

synacktiv.com

Published on synacktiv.com

Written by Gaetan Ferry - 12/12/2019 - in Pentest - Download

The author, on synacktiv.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

Root cause

Likely the root cause is that the plugin manager file reads command-line arguments from a prototype property (kbnWorkerArgv) that can be polluted via the Timelion prototype pollution, and the file inclusion allows loading that file to trigger the gadget.

Impact

An attacker could achieve remote code execution on the Kibana server, as demonstrated by obtaining a reverse shell.

What the attacker needed

Kibana version 6.2.2 (outdated); Timelion feature enabled; Network access to Kibana

How it was found

  1. Trigger the prototype pollution in Timelion to set the kbnWorkerArgv property to a command that installs a plugin from a remote URL.
  2. Use the local file inclusion endpoint to include the cli_plugin/cli.js file, which reads the polluted property and executes the plugin installation command.
  3. The Kibana server downloads and installs the malicious plugin from the attacker's HTTP server.
  4. The plugin's index.js executes a reverse shell, giving the attacker a shell on the server.

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.

This report describes how two known security bugs in an old version of Kibana (a data visualisation tool) were combined in a new way. One bug let an attacker read any file on the server, and the other let them change a global JavaScript setting. By using the file-reading bug to load a specific file that trusted that setting, the attacker could make the server install a malicious plugin, which then ran code on 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.