File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,7 @@ class ActionControllerClass extends DataFlow::ClassNode {
83
83
}
84
84
}
85
85
86
- // TODO: private
87
- DataFlow:: LocalSourceNode actionControllerInstance ( ) {
86
+ private DataFlow:: LocalSourceNode actionControllerInstance ( ) {
88
87
result = any ( ActionControllerClass cls ) .getSelf ( )
89
88
}
90
89
Original file line number Diff line number Diff line change 2
2
3
3
private import codeql.ruby.Concepts
4
4
private import codeql.ruby.DataFlow
5
+ private import codeql.ruby.ApiGraphs
5
6
private import codeql.ruby.frameworks.ActionController
6
7
7
8
/** Modeling for `ActionDispatch::Request`. */
8
9
module Request {
9
10
/**
10
- * An instance of `ActionDispatch::Request`.
11
- */
12
- private class RequestNode extends DataFlow:: CallNode {
13
- RequestNode ( ) { this = actionControllerInstance ( ) .getAMethodCall ( "request" ) }
14
- }
15
-
16
- /**
17
- * A method call on `request`.
11
+ * A method call against an `ActionDispatch::Request` instance.
18
12
*/
19
13
private class RequestMethodCall extends DataFlow:: CallNode {
20
14
RequestMethodCall ( ) {
21
- any ( RequestNode r ) .( DataFlow:: LocalSourceNode ) .flowsTo ( this .getReceiver ( ) )
15
+ any ( ActionControllerClass cls )
16
+ .getSelf ( )
17
+ .getAMethodCall ( "request" )
18
+ .( DataFlow:: LocalSourceNode )
19
+ .flowsTo ( this .getReceiver ( ) ) or
20
+ this =
21
+ API:: getTopLevelMember ( "ActionDispatch" )
22
+ .getMember ( "Request" )
23
+ .getInstance ( )
24
+ .getAMethodCall ( _)
22
25
}
23
26
}
24
27
You can’t perform that action at this time.
0 commit comments