Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96e4633

Browse files
committed
remove more code that did nothing
1 parent a9595af commit 96e4633

1 file changed

Lines changed: 1 addition & 25 deletions

File tree

javascript/ql/lib/semmle/javascript/security/dataflow/ResourceExhaustionQuery.qll

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class Configuration extends TaintTracking::Configuration {
2727

2828
override predicate isAdditionalTaintStep(DataFlow::Node src, DataFlow::Node dst) {
2929
isNumericFlowStep(src, dst)
30-
or
31-
// reuse most existing taint steps
32-
isRestrictedAdditionalTaintStep(src, dst)
3330
}
3431

3532
override predicate isSanitizerGuard(TaintTracking::SanitizerGuardNode guard) {
@@ -41,34 +38,13 @@ class Configuration extends TaintTracking::Configuration {
4138
}
4239
}
4340

44-
predicate isRestrictedAdditionalTaintStep(DataFlow::Node src, DataFlow::Node dst) {
45-
TaintTracking::sharedTaintStep(src, dst) and
46-
not dst.asExpr() instanceof AddExpr and
47-
not dst.(DataFlow::MethodCallNode).calls(src, "toString")
48-
}
49-
50-
/**
51-
* Holds if data may flow from `src` to `dst` as a number.
52-
*/
41+
/** Holds if data is converted to a number from `src` to `dst`. */
5342
predicate isNumericFlowStep(DataFlow::Node src, DataFlow::Node dst) {
54-
// steps that introduce or preserve a number
55-
dst.(DataFlow::PropRead).accesses(src, ["size"])
56-
or
5743
exists(DataFlow::CallNode c |
5844
c = dst and
5945
src = c.getAnArgument()
6046
|
6147
c = DataFlow::globalVarRef("Math").getAMemberCall(_) or
6248
c = DataFlow::globalVarRef(["Number", "parseInt", "parseFloat"]).getACall()
6349
)
64-
or
65-
exists(Expr dstExpr, Expr srcExpr |
66-
dstExpr = dst.asExpr() and
67-
srcExpr = src.asExpr()
68-
|
69-
dstExpr.(BinaryExpr).getAnOperand() = srcExpr and
70-
not dstExpr instanceof AddExpr
71-
or
72-
dstExpr.(PlusExpr).getOperand() = srcExpr
73-
)
7450
}

0 commit comments

Comments
 (0)