1616import rust
1717import codeql.rust.dataflow.DataFlow
1818import codeql.rust.dataflow.TaintTracking
19- import codeql.rust.dataflow.FlowSource
20- import codeql.rust.dataflow.FlowSink
19+ import codeql.rust.security.InsecureCookieExtensions
2120
2221/**
2322 * A data flow configuration for tracking values representing cookies without the
24- * 'secure' flag set.
23+ * 'secure' attribute set.
2524 */
2625module InsecureCookieConfig implements DataFlow:: ConfigSig {
26+ import InsecureCookie
27+
2728 predicate isSource ( DataFlow:: Node node ) {
2829 // creation of a cookie or cookie configuration with default, insecure settings
29- sourceNode ( node , "cookie-create" )
30+ node instanceof Source
3031 }
3132
3233 predicate isSink ( DataFlow:: Node node ) {
3334 // use of a cookie or cookie configuration
34- sinkNode ( node , "cookie-use" )
35+ node instanceof Sink
36+ }
37+
38+ predicate isBarrier ( DataFlow:: Node node ) {
39+ node instanceof Barrier
3540 }
3641
3742 predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
@@ -42,5 +47,6 @@ module InsecureCookieFlow = TaintTracking::Global<InsecureCookieConfig>;
4247import InsecureCookieFlow:: PathGraph
4348
4449from InsecureCookieFlow:: PathNode sourceNode , InsecureCookieFlow:: PathNode sinkNode
45- where InsecureCookieFlow:: flowPath ( sourceNode , sinkNode )
50+ where
51+ InsecureCookieFlow:: flowPath ( sourceNode , sinkNode )
4652select sinkNode .getNode ( ) , sourceNode , sinkNode , "Cookie attribute 'Secure' is not set to true."
0 commit comments