Skip to content

Commit 0456d47

Browse files
edvraaowen-mc
authored andcommitted
Fix path tracking
1 parent 4576b16 commit 0456d47

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ predicate isNetHttpCookieFlow(DataFlow::PathNode source, DataFlow::PathNode sink
2727
source = sensitiveName and
2828
sink = setCookieSink
2929
or
30-
exists(BoolToNetHttpCookieTrackingConfiguration cfg |
31-
cfg.hasFlow(source.getNode(), setCookieSink.getNode()) and
30+
exists(BoolToNetHttpCookieTrackingConfiguration cfg, DataFlow::PathNode setCookieSink2 |
31+
cfg.hasFlowPath(source, setCookieSink2) and
3232
source.getNode().getBoolValue() = false and
33-
sink = setCookieSink
33+
sink = setCookieSink2 and
34+
setCookieSink.getNode() = setCookieSink2.getNode()
3435
)
3536
)
3637
)
@@ -48,18 +49,20 @@ predicate isGorillaSessionsCookieFlow(DataFlow::PathNode source, DataFlow::PathN
4849
source = cookieStoreCreate and
4950
sink = sessionSave
5051
or
51-
exists(GorillaSessionOptionsTrackingConfiguration cfg, DataFlow::PathNode options |
52-
cfg.hasFlow(options.getNode(), sessionSave.getNode()) and
52+
exists(GorillaSessionOptionsTrackingConfiguration cfg, DataFlow::PathNode options, DataFlow::PathNode sessionSave2 |
53+
cfg.hasFlowPath(options, sessionSave2) and
5354
(
5455
not any(BoolToGorillaSessionOptionsTrackingConfiguration boolCfg)
5556
.hasFlowTo(sessionSave.getNode()) and
56-
sink = sessionSave and
57-
source = options
57+
sink = sessionSave2 and
58+
source = options and
59+
sessionSave.getNode() = sessionSave2.getNode()
5860
or
59-
exists(BoolToGorillaSessionOptionsTrackingConfiguration boolCfg |
60-
boolCfg.hasFlow(source.getNode(), sessionSave.getNode()) and
61+
exists(BoolToGorillaSessionOptionsTrackingConfiguration boolCfg, DataFlow::PathNode sessionSave3 |
62+
boolCfg.hasFlowPath(source, sessionSave3) and
6163
source.getNode().getBoolValue() = false and
62-
sink = sessionSave
64+
sink = sessionSave3 and
65+
sessionSave.getNode() = sessionSave3.getNode()
6366
)
6467
)
6568
)

0 commit comments

Comments
 (0)