Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 2f175e3

Browse files
committed
Oauth2 state query: remove unnecessary isSource overload
1 parent 8f99972 commit 2f175e3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ql/src/Security/CWE-352/ConstantOauth2State.ql

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,15 @@ predicate privateUrlFlowsToAuthCodeUrlCall(DataFlow::CallNode call) {
112112
class FlowToPrint extends DataFlow::Configuration {
113113
FlowToPrint() { this = "FlowToPrint" }
114114

115-
predicate isSource(DataFlow::Node source, DataFlow::CallNode call) {
116-
exists(AuthCodeURL m | call = m.getACall() | source = call.getResult())
117-
}
118-
119115
predicate isSink(DataFlow::Node sink, DataFlow::CallNode call) {
120116
exists(Fmt::Printer printer | call = printer.getACall() | sink = call.getArgument(_))
121117
or
122118
exists(LoggerCall logCall | call = logCall | sink = logCall.getAMessageComponent())
123119
}
124120

125-
override predicate isSource(DataFlow::Node source) { isSource(source, _) }
121+
override predicate isSource(DataFlow::Node source) {
122+
source = any(AuthCodeURL m).getACall().getResult()
123+
}
126124

127125
override predicate isSink(DataFlow::Node sink) { isSink(sink, _) }
128126
}
@@ -131,7 +129,7 @@ class FlowToPrint extends DataFlow::Configuration {
131129
predicate resultFlowsToPrinter(DataFlow::CallNode authCodeURLCall) {
132130
exists(FlowToPrint cfg, DataFlow::PathNode source, DataFlow::PathNode sink |
133131
cfg.hasFlowPath(source, sink) and
134-
cfg.isSource(source.getNode(), authCodeURLCall)
132+
authCodeURLCall.getResult() = source.getNode()
135133
)
136134
}
137135

0 commit comments

Comments
 (0)