public void list() {
SysRole model = getModelByAttr(SysRole.class);
SQLUtils sql = new SQLUtils(" from sys_role t where 1=1 ");
if (model.getAttrValues().length != 0) {
sql.setAlias("t");
// 查询条件
sql.whereLike("name", model.getStr("name"));
}
SQLUtils.java
public void whereLike(String attrName, String value) {
if (StrUtils.isNotEmpty(value)) {
sqlBuffer.append(" AND " + getAttrName(attrName) + " LIKE '%").append(value).append("%'");
}
}
query here doesn't go through ORM nor data binding procedures.
full error msg appears in response too.
most queries DO go through data binding procedures.
The whereLike implementation is vulnerable to SQL injection.
admin login required.
RoleController.java
SQLUtils.java
query here doesn't go through ORM nor data binding procedures. full error msg appears in response too.
most queries DO go through data binding procedures. The whereLike implementation is vulnerable to SQL injection.
EDIT: add more detail