mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
JS: Replace ClearTextLogging::isSanitizerEdge with a node
This commit is contained in:
@@ -27,10 +27,6 @@ class Configuration extends TaintTracking::Configuration {
|
||||
|
||||
override predicate isSanitizer(DataFlow::Node node) { node instanceof CleartextLogging::Barrier }
|
||||
|
||||
override predicate isSanitizerEdge(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
CleartextLogging::isSanitizerEdge(pred, succ)
|
||||
}
|
||||
|
||||
override predicate isAdditionalTaintStep(DataFlow::Node src, DataFlow::Node trg) {
|
||||
CleartextLogging::isAdditionalTaintStep(src, trg)
|
||||
}
|
||||
|
||||
@@ -175,12 +175,24 @@ module CleartextLogging {
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `Barrier` instead, sanitized have been replaced by sanitized nodes.
|
||||
*
|
||||
* Holds if the edge `pred` -> `succ` should be sanitized for clear-text logging of sensitive information.
|
||||
*/
|
||||
predicate isSanitizerEdge(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
deprecated predicate isSanitizerEdge(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
succ.(DataFlow::PropRead).getBase() = pred
|
||||
}
|
||||
|
||||
private class PropReadAsBarrier extends Barrier {
|
||||
PropReadAsBarrier() {
|
||||
this = any(DataFlow::PropRead read).getBase() and
|
||||
// the 'foo' in 'foo.bar()' may have flow, we only want to suppress plain property reads
|
||||
not this = any(DataFlow::MethodCallNode call).getReceiver() and
|
||||
// do not block custom taint steps from this node
|
||||
not isAdditionalTaintStep(this, _)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the edge `src` -> `trg` is an additional taint-step for clear-text logging of sensitive information.
|
||||
*/
|
||||
|
||||
@@ -33,10 +33,6 @@ class Configuration extends TaintTracking::Configuration {
|
||||
|
||||
override predicate isSanitizer(DataFlow::Node node) { node instanceof Barrier }
|
||||
|
||||
override predicate isSanitizerEdge(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
CleartextLogging::isSanitizerEdge(pred, succ)
|
||||
}
|
||||
|
||||
override predicate isAdditionalTaintStep(DataFlow::Node src, DataFlow::Node trg) {
|
||||
CleartextLogging::isAdditionalTaintStep(src, trg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user