Skip to content

Commit 591d81b

Browse files
committed
remove saniter which was responsible for a defensive technique
1 parent 1e1d42f commit 591d81b

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

python/ql/src/experimental/Security/CWE-287-ConstantSecretKey/WebAppConstantSecretKey.ql

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,6 @@ import semmle.python.dataflow.new.TaintTracking
2020
import WebAppConstantSecretKeyDjango
2121
import WebAppConstantSecretKeyFlask
2222

23-
private predicate stringConstCompare(DataFlow::GuardNode g, ControlFlowNode node, boolean branch) {
24-
exists(CompareNode cn | cn = g |
25-
exists(StrConst str_const, Cmpop op |
26-
op = any(Eq eq) and branch = false
27-
or
28-
op = any(NotEq ne) and branch = true
29-
|
30-
cn.operands(str_const.getAFlowNode(), op, node)
31-
or
32-
cn.operands(node, op, str_const.getAFlowNode())
33-
)
34-
)
35-
}
36-
37-
class StringConstCompareBarrier extends DataFlow::Node {
38-
StringConstCompareBarrier() {
39-
this = DataFlow::BarrierGuard<stringConstCompare/3>::getABarrierNode()
40-
}
41-
}
42-
4323
newtype TFrameWork =
4424
Flask() or
4525
Django()
@@ -58,17 +38,6 @@ module WebAppConstantSecretKeyConfig implements DataFlow::StateConfigSig {
5838
or
5939
state = Django() and DjangoConstantSecretKeyConfig::isSink(sink)
6040
}
61-
62-
predicate isBarrier(DataFlow::Node sanitizer, FlowState state) {
63-
(state = Flask() or state = Django()) and
64-
sanitizer instanceof StringConstCompareBarrier
65-
}
66-
67-
predicate isAdditionalFlowStep(
68-
DataFlow::Node node1, FlowState state1, DataFlow::Node node2, FlowState state2
69-
) {
70-
none()
71-
}
7241
}
7342

7443
module WebAppConstantSecretKey = TaintTracking::GlobalWithState<WebAppConstantSecretKeyConfig>;

0 commit comments

Comments
 (0)