@@ -17,7 +17,7 @@ import codeql.ruby.DataFlow
1717import codeql.ruby.dataflow.internal.DataFlowPublic
1818import codeql.ruby.security.ConditionalBypassQuery
1919import codeql.ruby.security.SensitiveActions
20- import DataFlow :: PathGraph
20+ import ConditionalBypassFlow :: PathGraph
2121
2222/**
2323 * Holds if the value of `nd` flows into `guard`.
@@ -69,15 +69,18 @@ class SensitiveActionGuardComparisonOperand extends Sink {
6969 * control if `action` should be executed or not.
7070 */
7171predicate isTaintedGuardForSensitiveAction (
72- DataFlow:: PathNode sink , DataFlow:: PathNode source , SensitiveAction action
72+ ConditionalBypassFlow:: PathNode sink , ConditionalBypassFlow:: PathNode source ,
73+ SensitiveAction action
7374) {
7475 action = sink .getNode ( ) .( Sink ) .getAction ( ) and
7576 // exclude the intermediary sink
7677 not sink .getNode ( ) instanceof SensitiveActionGuardComparisonOperand and
77- exists ( Configuration cfg | cfg . hasFlowPath ( source , sink ) )
78+ ConditionalBypassFlow :: flowPath ( source , sink )
7879}
7980
80- from DataFlow:: PathNode source , DataFlow:: PathNode sink , SensitiveAction action
81+ from
82+ ConditionalBypassFlow:: PathNode source , ConditionalBypassFlow:: PathNode sink ,
83+ SensitiveAction action
8184where isTaintedGuardForSensitiveAction ( sink , source , action )
8285select sink .getNode ( ) , source , sink , "This condition guards a sensitive $@, but a $@ controls it." ,
8386 action , "action" , source .getNode ( ) , "user-provided value"
0 commit comments