sys/duplicate/check SQL注入 #4737

dev
zhangdaiscott 2 years ago
parent 8ed2da601b
commit ca1218f792

@ -30,6 +30,11 @@ public class SqlInjectionUtil {
/**正则 show tables*/
private final static String SHOW_TABLES = "show\\s+tables";
/**
* sleep
*/
private final static Pattern FUN_SLEEP = Pattern.compile("sleep\\([\\d\\.]*\\)");
/**
* sql
*/
@ -282,5 +287,13 @@ public class SqlInjectionUtil {
log.error(error);
throw new RuntimeException(error);
}
// issues/4737 sys/duplicate/check SQL注入 #4737
Matcher sleepMatcher = FUN_SLEEP.matcher(str);
if(sleepMatcher.find()){
String error = "请注意值可能存在SQL注入风险---> sleep";
log.error(error);
throw new RuntimeException(error);
}
}
}

Loading…
Cancel
Save