mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
30 lines
877 B
Plaintext
30 lines
877 B
Plaintext
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 |