whycxzp
2023-10-20 b91919258e00d91e74e585cc473bc6aa5ff5b4fb
路径遍历缺陷12
1个文件已修改
3 ■■■■■ 已修改文件
src/main/java/com/whyc/service/UserWorkService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/UserWorkService.java
@@ -6,6 +6,7 @@
import com.whyc.mapper.UserWorkMapper;
import com.whyc.mapper.WorkAlarmMapper;
import com.whyc.pojo.UserWork;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.core.env.Environment;
@@ -153,6 +154,8 @@
    public Response deleteAlarmFile(String fileNames, int stationId, String afterOrBefore) {
        //过滤特殊字符,避免路径遍历攻击
        afterOrBefore = ActionUtil.filterFileName(afterOrBefore);
        String names[] = fileNames.split(",");
        String fileDirName = "";
        int configType = Integer.parseInt(environment.getProperty("configFile.type"));