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 {
3434 this .getReturnType ( ) instanceof TypeString
3535 }
3636}
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 33import java
44private import semmle.code.java.frameworks.spring.SpringController
55private import semmle.code.java.frameworks.MyBatis
6+ private import semmle.code.java.frameworks.Jdbc
67
78/** A method that is not protected from CSRF by default. */
89abstract class CsrfUnprotectedMethod extends Method { }
@@ -45,3 +46,11 @@ private class MyBatisMapperDatabaseUpdateMethod extends DatabaseUpdateMethod {
4546 )
4647 }
4748}
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