mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
25 lines
716 B
Java
25 lines
716 B
Java
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.jdbc.SQL;
|
|
|
|
public class MyBatisProvider {
|
|
|
|
public String badDelete(@Param("input") final String input) {
|
|
return "DELETE FROM users WHERE username = '" + input + "';";
|
|
}
|
|
|
|
public String badUpdate(@Param("input") final String input) {
|
|
String s = (new SQL() {
|
|
{
|
|
this.UPDATE("users");
|
|
this.SET("balance = 0");
|
|
this.WHERE("username = '" + input + "'");
|
|
}
|
|
}).toString();
|
|
return s;
|
|
}
|
|
|
|
public String badInsert(@Param("input") final String input) {
|
|
return "INSERT INTO users VALUES (1, '" + input + "', 'hunter2');";
|
|
}
|
|
}
|