mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import javascript
|
||||
|
||||
class TestTaintTrackingConfiguration extends TaintTracking::Configuration {
|
||||
TestTaintTrackingConfiguration() {
|
||||
this = "TestTaintTrackingConfiguration"
|
||||
}
|
||||
|
||||
override predicate isSource(DataFlow::Node src) {
|
||||
exists (VariableDeclarator vd |
|
||||
vd.getBindingPattern().(VarDecl).getName().matches("%source%") and
|
||||
src.asExpr() = vd.getInit()
|
||||
)
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node snk) {
|
||||
exists (VariableDeclarator vd |
|
||||
vd.getBindingPattern().(VarDecl).getName().matches("%sink%") and
|
||||
snk.asExpr() = vd.getInit()
|
||||
)
|
||||
}
|
||||
|
||||
override predicate isSanitizer(DataFlow::Node src, DataFlow::Node snk) {
|
||||
src = src and
|
||||
snk.asExpr().(PropAccess).getPropertyName() = "notTracked"
|
||||
}
|
||||
}
|
||||
|
||||
from TestTaintTrackingConfiguration tttc, DataFlow::Node src, DataFlow::Node snk
|
||||
where tttc.hasFlow(src, snk)
|
||||
select src, snk
|
||||
Reference in New Issue
Block a user