Apache Flink 两个高危漏洞(CVE-2020-17518&CVE-2020-17519),分别是任意文件写入和任意文件读取.
1、任意文件读取
原代码
String filename = handlerRequest.getPathParameter(LogFileNamePathParameter.class);
补丁
String filename = new File(handlerRequest.getPathParameter(LogFileNamePathParameter.class)).getName();
通过补丁代码,粗略知道handlerRequest
变量可控, 能够实现任意文件读取.
2、任意文件写入
原代码
final Path dest = currentUploadDir.resolve(new File(fileUpload.getFilename()).getName()); fileUpload.renameTo(dest.toFile());
补丁
final Path dest = currentUploadDir.resolve(new File(fileUpload.getFilename()).getName()); fileUpload.renameTo(dest.toFile());
通过补丁代码, 粗略知道fileUpload
变量可控, 能够实现任意文件写入.