mirror of
https://github.com/dataease/dataease.git
synced 2026-05-14 21:12:33 +08:00
fix: 修复数据集存在SQL注入漏洞
This commit is contained in:
@@ -95,6 +95,9 @@ public class EsProvider extends Provider {
|
||||
try {
|
||||
String sql;
|
||||
if (datasourceRequest.getTable() != null) {
|
||||
if (!getTables(datasourceRequest).stream().map(DatasetTableDTO::getTableName).collect(Collectors.toList()).contains(datasourceRequest.getTable())) {
|
||||
DEException.throwException("无效的表名!");
|
||||
}
|
||||
sql = "select * from \"" + datasourceRequest.getTable() + "\" limit 0";
|
||||
} else {
|
||||
sql = datasourceRequest.getQuery();
|
||||
|
||||
Reference in New Issue
Block a user