From 10accb6d6b9a874a28bd99bc111fcdaf7bc4ba40 Mon Sep 17 00:00:00 2001 From: wenshao Date: Wed, 28 Aug 2013 11:00:00 +0800 Subject: [PATCH] improve sql wall --- .../com/alibaba/druid/wall/spi/MySqlWallVisitor.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/druid/wall/spi/MySqlWallVisitor.java b/src/main/java/com/alibaba/druid/wall/spi/MySqlWallVisitor.java index f74e23e3ef..54808551aa 100644 --- a/src/main/java/com/alibaba/druid/wall/spi/MySqlWallVisitor.java +++ b/src/main/java/com/alibaba/druid/wall/spi/MySqlWallVisitor.java @@ -456,14 +456,24 @@ public class MySqlWallVisitor extends MySqlASTVisitorAdapter implements WallVisi || text.indexOf("or") != -1 // || text.indexOf("and") != -1 // || text.indexOf("union") != -1 // + + || text.indexOf("select") != -1 // || text.indexOf("delete") != -1 // + || text.indexOf("insert") != -1 // || text.indexOf("update") != -1 // + || text.indexOf("create") != -1 // || text.indexOf("drop") != -1 // - || text.indexOf("drop") != -1 // + || text.indexOf("alter") != -1 // + || text.indexOf("truncate") != -1 // + || text.indexOf("information_schema") != -1 // || text.indexOf("mysql") != -1 // || text.indexOf("performance_schema") != -1 // + + || text.indexOf("sleep") != -1 // + || text.indexOf("benchmark") != -1 // + || text.indexOf("load_file") != -1 // ) { addViolation(new IllegalSQLObjectViolation(ErrorCode.EVIL_HINTS, "evil hints", SQLUtils.toMySqlString(x))); }