mirror of
https://github.com/dataease/dataease.git
synced 2026-06-17 04:51:43 +08:00
fix: 修复 20260616083022相关安全漏洞
This commit is contained in:
committed by
fit2cloud-chenyw
parent
436a90307a
commit
e160b6c42e
@@ -42,7 +42,7 @@ public class LinkInterceptor implements HandlerInterceptor {
|
||||
|
||||
String requestURI = ServletUtils.request().getRequestURI();
|
||||
if (StringUtils.startsWith(requestURI, WhitelistUtils.getContextPath())) {
|
||||
requestURI = requestURI.replaceFirst(WhitelistUtils.getContextPath(), "");
|
||||
requestURI = StringUtils.replaceOnce(requestURI, WhitelistUtils.getContextPath(), "");
|
||||
}
|
||||
if (StringUtils.startsWith(requestURI, AuthConstant.DE_API_PREFIX)) {
|
||||
requestURI = requestURI.replaceFirst(AuthConstant.DE_API_PREFIX, "");
|
||||
|
||||
@@ -74,8 +74,8 @@ public class FileUtils {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public static void validateExist(String path) {
|
||||
File dir = new File(path);
|
||||
public static void validateExist(String path) throws IOException {
|
||||
File dir = new File(path).getCanonicalFile();
|
||||
if (dir.exists()) return;
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class WhitelistUtils {
|
||||
public static boolean match(String requestURI) {
|
||||
invalidUrl(requestURI);
|
||||
if (StringUtils.startsWith(requestURI, getContextPath())) {
|
||||
requestURI = requestURI.replaceFirst(getContextPath(), "");
|
||||
requestURI = StringUtils.replaceOnce(requestURI, getContextPath(), "");
|
||||
}
|
||||
if (StringUtils.startsWith(requestURI, AuthConstant.DE_API_PREFIX)) {
|
||||
requestURI = requestURI.replaceFirst(AuthConstant.DE_API_PREFIX, "");
|
||||
|
||||
Reference in New Issue
Block a user