|
@@ -3,6 +3,7 @@ package org.jeecg.common.util;
|
|
import cn.hutool.crypto.SecureUtil;
|
|
import cn.hutool.crypto.SecureUtil;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
|
+
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.Field;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
@@ -21,7 +22,7 @@ public class SqlInjectionUtil {
|
|
* (上线修改值 20200501,同步修改前端的盐值)
|
|
* (上线修改值 20200501,同步修改前端的盐值)
|
|
*/
|
|
*/
|
|
private final static String TABLE_DICT_SIGN_SALT = "20200501";
|
|
private final static String TABLE_DICT_SIGN_SALT = "20200501";
|
|
- private final static String XSS_STR = "and |extractvalue|updatexml|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+|user()";
|
|
|
|
|
|
+ private final static String XSS_STR = "and |extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+|user()";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 正则 user() 匹配更严谨
|
|
* 正则 user() 匹配更严谨
|
|
@@ -33,7 +34,7 @@ public class SqlInjectionUtil {
|
|
/**
|
|
/**
|
|
* sql注释的正则
|
|
* sql注释的正则
|
|
*/
|
|
*/
|
|
- private final static Pattern SQL_ANNOTATION = Pattern.compile("/\\*.*\\*/");
|
|
|
|
|
|
+ private final static Pattern SQL_ANNOTATION = Pattern.compile("/\\*[\\s\\S]*\\*/");
|
|
|
|
|
|
/**
|
|
/**
|
|
* 针对表字典进行额外的sign签名校验(增加安全机制)
|
|
* 针对表字典进行额外的sign签名校验(增加安全机制)
|
|
@@ -167,7 +168,7 @@ public class SqlInjectionUtil {
|
|
*/
|
|
*/
|
|
//@Deprecated
|
|
//@Deprecated
|
|
public static void specialFilterContentForDictSql(String value) {
|
|
public static void specialFilterContentForDictSql(String value) {
|
|
- String specialXssStr = " exec |extractvalue|updatexml| insert | select | delete | update | drop | count | chr | mid | master | truncate | char | declare |;|+|user()";
|
|
|
|
|
|
+ String specialXssStr = " exec |extractvalue|updatexml|geohash|gtid_subset|gtid_subtract| insert | select | delete | update | drop | count | chr | mid | master | truncate | char | declare |;|+|user()";
|
|
String[] xssArr = specialXssStr.split("\\|");
|
|
String[] xssArr = specialXssStr.split("\\|");
|
|
if (value == null || "".equals(value)) {
|
|
if (value == null || "".equals(value)) {
|
|
return;
|
|
return;
|
|
@@ -201,7 +202,7 @@ public class SqlInjectionUtil {
|
|
*/
|
|
*/
|
|
//@Deprecated
|
|
//@Deprecated
|
|
public static void specialFilterContentForOnlineReport(String value) {
|
|
public static void specialFilterContentForOnlineReport(String value) {
|
|
- String specialXssStr = " exec |extractvalue|updatexml| insert | delete | update | drop | chr | mid | master | truncate | char | declare |user()";
|
|
|
|
|
|
+ String specialXssStr = " exec |extractvalue|updatexml|geohash|gtid_subset|gtid_subtract| insert | delete | update | drop | chr | mid | master | truncate | char | declare |user()";
|
|
String[] xssArr = specialXssStr.split("\\|");
|
|
String[] xssArr = specialXssStr.split("\\|");
|
|
if (value == null || "".equals(value)) {
|
|
if (value == null || "".equals(value)) {
|
|
return;
|
|
return;
|