зеркало из https://github.com/github/codeql.git
Go: Add tentative support for speculative taint flow.
This commit is contained in:
Родитель
635071fe8a
Коммит
fae71756eb
|
@ -428,3 +428,25 @@ private class ClearSanitizer extends DefaultTaintSanitizer {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
import SpeculativeTaintFlow
|
||||
|
||||
private module SpeculativeTaintFlow {
|
||||
private import semmle.go.dataflow.internal.DataFlowDispatch as DataFlowDispatch
|
||||
|
||||
predicate speculativeTaintStep(DataFlow::Node src, DataFlow::Node sink) {
|
||||
exists(DataFlowPrivate::DataFlowCall call, DataFlowDispatch::ArgumentPosition argpos |
|
||||
// TODO: exclude neutrals and anything that has QL modeling.
|
||||
not exists(DataFlowDispatch::viableCallable(call)) and
|
||||
src.(DataFlow::ArgumentNode).argumentOf(call, argpos)
|
||||
|
|
||||
argpos != -1 and
|
||||
sink.(DataFlow::PostUpdateNode)
|
||||
.getPreUpdateNode()
|
||||
.(DataFlow::ArgumentNode)
|
||||
.argumentOf(call, -1)
|
||||
or
|
||||
sink.(DataFlowPrivate::OutNode).getCall() = call
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче