门户模板文件上传漏洞补丁
在函数开头添加了对filename中是否存在“../”进行了校验
分析函数体
File portalRootFolder = SystemEnvironment.getClusterPublicFolder("portal");
String fileType = fileTypeEnum.getKey();
File fileTypeFolder = new File(portalRootFolder, fileType);
if (!fileTypeFolder.exists()) {
fileTypeFolder.mkdir();
}
File targetFile = new File(fileTypeFolder, fileName);
FileUtils.copyFile(sourceFile, targetFile);
processUploadForH5任意文件上传漏洞补丁
增加了hashPath方法,以此来强制指定传进来的str为数字,在uploadFileForH5方法中对fileSize,lastModifiedDate,currentPageId这三个参数使用了该方法,那么问题也就出在这三个参数,而在uploadFileForH5方法中使用 getUploadTempFile方法来新建 tempFile 文件,在getUploadTempFile方法中拼接了lastModifiedDate,currentPageId参数,导致文件名可控
原文始发于微信公众号(仙友道):补丁分析
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论