use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest127 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setCommentAllow(false);
String sql = "SELECT name, '******' password, createTime from user where name like '-1079%' OR (8868=8022) AND '%'=''";
Assert.assertFalse(provider.checkValid(sql));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest128 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setCommentAllow(false);
String sql = "SELECT name, '******' password, createTime from user where name like 'admin' AND (CASE WHEN (7885=7885) THEN 1 ELSE 0 END)";
Assert.assertFalse(provider.checkValid(sql));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest131 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setCommentAllow(true);
Assert.assertFalse(provider.checkValid("select * from t where id = 1 /*!30000union all select 2*/"));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest134 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setSelectUnionCheck(true);
Assert.assertTrue(provider.checkValid("SELECT 1 FROM dual WHERE 1 = '1'''''''''''''UNION SELECT '2';"));
//end of comment --> false
Assert.assertFalse(provider.checkValid("SELECT 1 FROM t WHERE 1 = '1'''''''''''''UNION SELECT '2' --;"));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest135 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertFalse(provider.checkValid("SELECT * FROM Users WHERE id = '1' AND MID(VERSION(),1,1) = '5';"));
}
Aggregations