Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfc4a6a

Browse files
committed
Make Timing use new API
1 parent 39762da commit cfc4a6a

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

go/ql/src/experimental/CWE-203/Timing.ql

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111

1212
import go
13-
import DataFlow::PathGraph
1413
import semmle.go.security.SensitiveActions
1514

1615
private predicate isBadResult(DataFlow::Node e) {
@@ -97,17 +96,19 @@ private class SensitiveStringSink extends Sink {
9796
}
9897
}
9998

100-
class SecretTracking extends TaintTracking::Configuration {
101-
SecretTracking() { this = "SecretTracking" }
102-
103-
override predicate isSource(DataFlow::Node source) {
99+
module Config implements DataFlow::ConfigSig {
100+
predicate isSource(DataFlow::Node source) {
104101
source instanceof UntrustedFlowSource and not isBadResult(source)
105102
}
106103

107-
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink and not isBadResult(sink) }
104+
predicate isSink(DataFlow::Node sink) { sink instanceof Sink and not isBadResult(sink) }
108105
}
109106

110-
from SecretTracking cfg, DataFlow::PathNode source, DataFlow::PathNode sink
111-
where cfg.hasFlowPath(source, sink)
107+
module Flow = TaintTracking::Global<Config>;
108+
109+
import Flow::PathGraph
110+
111+
from Flow::PathNode source, Flow::PathNode sink
112+
where Flow::flowPath(source, sink)
112113
select sink.getNode(), source, sink, "$@ may be vulnerable to timing attacks.", source.getNode(),
113114
"Hardcoded String"

0 commit comments

Comments
 (0)