Conversation
smowton
left a comment
There was a problem hiding this comment.
Looks good! How are the results / CVE hits?
|
|
||
| override predicate isSink(DataFlow::Node sink) { this.isSink(sink, _) } | ||
|
|
||
| predicate isSink(DataFlow::Node sink, string kind) { kind = sink.(Sink).getKind() } |
|
|
||
| override predicate isSink(DataFlow::Node sink) { this.isSink(sink, _) } | ||
|
|
||
| predicate isSink(DataFlow::Node sink, string kind) { kind = sink.(Sink).getKind() } |
There was a problem hiding this comment.
| predicate isSink(DataFlow::Node sink, string kind) { kind = sink.(Sink).getKind() } | |
| predicate isSink(Sink sink, string kind) { kind = sink.getKind() } |
|
|
||
| predicate isSink(DataFlow::Node sink, string kind) { kind = sink.(Sink).getKind() } | ||
|
|
||
| override predicate isSanitizer(DataFlow::Node node) { none() } |
There was a problem hiding this comment.
This is already the default
| from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink, string kind | ||
| where cfg.hasFlowPath(source, sink) and cfg.isSink(sink.getNode(), kind) | ||
| select sink.getNode(), source, sink, | ||
| "$@ is a value generated with a cryptographically weak RNG used in $@.", source.getNode(), |
There was a problem hiding this comment.
| "$@ is a value generated with a cryptographically weak RNG used in $@.", source.getNode(), | |
| "$@ is generated with a cryptographically weak RNG used in $@.", source.getNode(), |
| "$@ is a value generated with a cryptographically weak RNG used in $@.", source.getNode(), | ||
| "Random number", sink.getNode(), kind |
There was a problem hiding this comment.
| "$@ is a value generated with a cryptographically weak RNG used in $@.", source.getNode(), | |
| "Random number", sink.getNode(), kind | |
| "$@ is generated with a cryptographically weak RNG used in $@.", source.getNode(), | |
| "A random number", sink.getNode(), kind |
There was a problem hiding this comment.
I assume you want "A random number generated with a cryptographically weak RNG is used in "?
There was a problem hiding this comment.
I was aiming at "is generated", but that's better
shati-patel
left a comment
There was a problem hiding this comment.
Just a few tiny comments, otherwise LGTM 😃
9ef8d4e to
3d0b09f
Compare
Also give it a precision
bd33cf7 to
511a143
Compare
|
The newest commit needs review, I think. I accidentally ran the dist-compare on the old version of this, so that's running again, huzzah. |
smowton
left a comment
There was a problem hiding this comment.
Restriction to first match seems ok to me, one possible cleanup
| kind != "a password-related function" | ||
| or | ||
| sink = | ||
| rank[1](DataFlow::PathNode sink2, int line | |
There was a problem hiding this comment.
rank[1] can become min I think
Note I moved the
WeakCryptoAlgorithmtests along with the insecure randomness ones because they share code.