File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
ruby/ql/lib/codeql/ruby/security Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -285,14 +285,22 @@ private module OrmTracking {
285
285
* A data flow configuration to track flow from finder calls to field accesses.
286
286
*/
287
287
private module Config implements DataFlow:: ConfigSig {
288
- predicate isSource ( DataFlow:: Node source ) { source instanceof OrmInstantiation }
288
+ predicate isSource ( DataFlow:: Node source ) {
289
+ // We currently only use ORM instances that come from a call site, so restrict the sources
290
+ // to calls. This works around a performance issue that would arise from using 'self' as a source
291
+ // in ActiveRecord models. Over time, library models should stop relying on OrmInstantiation and instead
292
+ // use API graphs or type-tracking the same way we track other types.
293
+ source instanceof OrmInstantiation and source instanceof DataFlow:: CallNode
294
+ }
289
295
290
296
// Select any call receiver and narrow down later
291
297
predicate isSink ( DataFlow:: Node sink ) { sink = any ( DataFlow:: CallNode c ) .getReceiver ( ) }
292
298
293
299
predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
294
300
Shared:: isAdditionalXssFlowStep ( node1 , node2 )
295
301
}
302
+
303
+ predicate isBarrierIn ( DataFlow:: Node node ) { node instanceof DataFlow:: SelfParameterNode }
296
304
}
297
305
298
306
import DataFlow:: Global< Config >
You can’t perform that action at this time.
0 commit comments