File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -34,3 +34,19 @@ class ResultSetGetStringMethod extends Method {
34
34
this .getReturnType ( ) instanceof TypeString
35
35
}
36
36
}
37
+
38
+ /** A method with the name `executeUpdate` declared in `java.sql.PreparedStatement`. */
39
+ class PreparedStatementExecuteUpdateMethod extends Method {
40
+ PreparedStatementExecuteUpdateMethod ( ) {
41
+ this .getDeclaringType ( ) instanceof TypePreparedStatement and
42
+ this .hasName ( "executeUpdate" )
43
+ }
44
+ }
45
+
46
+ /** A method with the name `executeLargeUpdate` declared in `java.sql.PreparedStatement`. */
47
+ class PreparedStatementExecuteLargeUpdateMethod extends Method {
48
+ PreparedStatementExecuteLargeUpdateMethod ( ) {
49
+ this .getDeclaringType ( ) instanceof TypePreparedStatement and
50
+ this .hasName ( "executeLargeUpdate" )
51
+ }
52
+ }
Original file line number Diff line number Diff line change 3
3
import java
4
4
private import semmle.code.java.frameworks.spring.SpringController
5
5
private import semmle.code.java.frameworks.MyBatis
6
+ private import semmle.code.java.frameworks.Jdbc
6
7
7
8
/** A method that is not protected from CSRF by default. */
8
9
abstract class CsrfUnprotectedMethod extends Method { }
@@ -45,3 +46,11 @@ private class MyBatisMapperDatabaseUpdateMethod extends DatabaseUpdateMethod {
45
46
)
46
47
}
47
48
}
49
+
50
+ /** A method declared in `java.sql.PreparedStatement` that updates a database. */
51
+ private class PreparedStatementDatabaseUpdateMethod extends DatabaseUpdateMethod {
52
+ PreparedStatementDatabaseUpdateMethod ( ) {
53
+ this instanceof PreparedStatementExecuteUpdateMethod or
54
+ this instanceof PreparedStatementExecuteLargeUpdateMethod
55
+ }
56
+ }
You can’t perform that action at this time.
0 commit comments