File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -214,19 +214,15 @@ class ActiveRecordSqlExecutionRange extends SqlExecution::Range {
214214 this .asExpr ( ) .getNode ( ) = mc .getSqlFragmentSinkArgument ( )
215215 )
216216 or
217- exists ( DataFlow:: CallNode executeCall |
218- executeCall .getReceiver ( ) = activeRecordConnectionInstance ( ) and
219- executeCall .getMethodName ( ) = "execute" and
220- this = executeCall .getArgument ( 0 ) and
221- unsafeSqlExpr ( this .asExpr ( ) .getExpr ( ) )
222- )
217+ this = activeRecordConnectionInstance ( ) .getAMethodCall ( "execute" ) .getArgument ( 0 ) and
218+ unsafeSqlExpr ( this .asExpr ( ) .getExpr ( ) )
223219 }
224220
225221 override DataFlow:: Node getSql ( ) { result = this }
226222}
227223
228- private DataFlow :: Node activeRecordConnectionInstance ( ) {
229- result = activeRecordClassApiNode ( ) .getAMethodCall ( "connection" )
224+ private API :: Node activeRecordConnectionInstance ( ) {
225+ result = activeRecordClassApiNode ( ) .getReturn ( "connection" )
230226}
231227
232228// TODO: model `ActiveRecord` sanitizers
You can’t perform that action at this time.
0 commit comments