Skip to content

Commit 71be426

Browse files
authored
Merge pull request github#13015 from kaspersv/kaspersv/js-explicit-this-receivers2
JS: Make implicit this receivers explicit
2 parents e925365 + f619a63 commit 71be426

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointCharacteristics.qll

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private class DomBasedXssSinkCharacteristic extends EndpointCharacteristic {
220220
) {
221221
endpointClass instanceof XssSinkType and
222222
isPositiveIndicator = true and
223-
confidence = maximalConfidence()
223+
confidence = this.maximalConfidence()
224224
}
225225
}
226226

@@ -238,7 +238,7 @@ private class TaintedPathSinkCharacteristic extends EndpointCharacteristic {
238238
) {
239239
endpointClass instanceof TaintedPathSinkType and
240240
isPositiveIndicator = true and
241-
confidence = maximalConfidence()
241+
confidence = this.maximalConfidence()
242242
}
243243
}
244244

@@ -256,7 +256,7 @@ private class SqlInjectionSinkCharacteristic extends EndpointCharacteristic {
256256
) {
257257
endpointClass instanceof SqlInjectionSinkType and
258258
isPositiveIndicator = true and
259-
confidence = maximalConfidence()
259+
confidence = this.maximalConfidence()
260260
}
261261
}
262262

@@ -274,7 +274,7 @@ private class NosqlInjectionSinkCharacteristic extends EndpointCharacteristic {
274274
) {
275275
endpointClass instanceof NosqlInjectionSinkType and
276276
isPositiveIndicator = true and
277-
confidence = maximalConfidence()
277+
confidence = this.maximalConfidence()
278278
}
279279
}
280280

@@ -296,7 +296,7 @@ private class ShellCommandInjectionFromEnvironmentSinkCharacteristic extends End
296296
) {
297297
endpointClass instanceof ShellCommandInjectionFromEnvironmentSinkType and
298298
isPositiveIndicator = true and
299-
confidence = maximalConfidence()
299+
confidence = this.maximalConfidence()
300300
}
301301
}
302302

@@ -335,7 +335,7 @@ abstract private class NotASinkCharacteristic extends EndpointCharacteristic {
335335
) {
336336
endpointClass instanceof NegativeType and
337337
isPositiveIndicator = true and
338-
confidence = highConfidence()
338+
confidence = this.highConfidence()
339339
}
340340
}
341341

@@ -354,7 +354,7 @@ abstract class LikelyNotASinkCharacteristic extends EndpointCharacteristic {
354354
) {
355355
endpointClass instanceof NegativeType and
356356
isPositiveIndicator = true and
357-
confidence = mediumConfidence()
357+
confidence = this.mediumConfidence()
358358
}
359359
}
360360

@@ -685,7 +685,7 @@ abstract private class StandardEndpointFilterCharacteristic extends EndpointFilt
685685
) {
686686
endpointClass instanceof NegativeType and
687687
isPositiveIndicator = true and
688-
confidence = mediumConfidence()
688+
confidence = this.mediumConfidence()
689689
}
690690
}
691691

@@ -786,7 +786,7 @@ abstract private class NosqlInjectionSinkEndpointFilterCharacteristic extends En
786786
) {
787787
endpointClass instanceof NosqlInjectionSinkType and
788788
isPositiveIndicator = false and
789-
confidence = mediumConfidence()
789+
confidence = this.mediumConfidence()
790790
}
791791
}
792792

@@ -817,7 +817,7 @@ private class ModeledSinkCharacteristic extends NosqlInjectionSinkEndpointFilter
817817
override predicate appliesToEndpoint(DataFlow::Node n) {
818818
exists(DataFlow::CallNode call | n = call.getAnArgument() |
819819
// Remove modeled sinks
820-
isArgumentToKnownLibrarySinkFunction(n)
820+
this.isArgumentToKnownLibrarySinkFunction(n)
821821
)
822822
}
823823
}
@@ -928,7 +928,7 @@ abstract private class SqlInjectionSinkEndpointFilterCharacteristic extends Endp
928928
) {
929929
endpointClass instanceof SqlInjectionSinkType and
930930
isPositiveIndicator = false and
931-
confidence = mediumConfidence()
931+
confidence = this.mediumConfidence()
932932
}
933933
}
934934

@@ -1002,7 +1002,7 @@ abstract private class TaintedPathSinkEndpointFilterCharacteristic extends Endpo
10021002
) {
10031003
endpointClass instanceof TaintedPathSinkType and
10041004
isPositiveIndicator = false and
1005-
confidence = mediumConfidence()
1005+
confidence = this.mediumConfidence()
10061006
}
10071007
}
10081008

@@ -1055,7 +1055,7 @@ abstract private class XssSinkEndpointFilterCharacteristic extends EndpointFilte
10551055
) {
10561056
endpointClass instanceof XssSinkType and
10571057
isPositiveIndicator = false and
1058-
confidence = mediumConfidence()
1058+
confidence = this.mediumConfidence()
10591059
}
10601060
}
10611061

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointTypes.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class EndpointType extends TEndpointType {
2424
*/
2525
abstract int getEncoding();
2626

27-
string toString() { result = getDescription() }
27+
string toString() { result = this.getDescription() }
2828
}
2929

3030
/** The `Negative` class that can be predicted by endpoint scoring models. */

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/NosqlInjectionATM.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class NosqlInjectionAtmConfig extends AtmConfig {
3333
sink.(NosqlInjection::Sink).getAFlowLabel() = label
3434
or
3535
// Allow effective sinks to have any taint label
36-
isEffectiveSink(sink)
36+
this.isEffectiveSink(sink)
3737
}
3838

3939
override predicate isSanitizer(DataFlow::Node node) {
@@ -49,11 +49,11 @@ class NosqlInjectionAtmConfig extends AtmConfig {
4949
DataFlow::Node src, DataFlow::Node trg, DataFlow::FlowLabel inlbl, DataFlow::FlowLabel outlbl
5050
) {
5151
// additional flow steps from the base (non-boosted) security query
52-
isBaseAdditionalFlowStep(src, trg, inlbl, outlbl)
52+
this.isBaseAdditionalFlowStep(src, trg, inlbl, outlbl)
5353
or
5454
// relaxed version of previous step to track taint through unmodeled NoSQL query objects
55-
isEffectiveSink(trg) and
56-
src = getASubexpressionWithinQuery(trg)
55+
this.isEffectiveSink(trg) and
56+
src = this.getASubexpressionWithinQuery(trg)
5757
}
5858

5959
/** Holds if src -> trg is an additional flow step in the non-boosted NoSql injection security query. */
@@ -80,9 +80,9 @@ class NosqlInjectionAtmConfig extends AtmConfig {
8080
* involving more complex queries.
8181
*/
8282
private DataFlow::Node getASubexpressionWithinQuery(DataFlow::Node query) {
83-
isEffectiveSink(query) and
83+
this.isEffectiveSink(query) and
8484
exists(DataFlow::SourceNode receiver |
85-
receiver = [getASubexpressionWithinQuery(query), query].getALocalSource()
85+
receiver = [this.getASubexpressionWithinQuery(query), query].getALocalSource()
8686
|
8787
result =
8888
[

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/TaintedPathATM.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TaintedPathAtmConfig extends AtmConfig {
2525
label = sink.(TaintedPath::Sink).getAFlowLabel()
2626
or
2727
// Allow effective sinks to have any taint label
28-
isEffectiveSink(sink)
28+
this.isEffectiveSink(sink)
2929
}
3030

3131
override predicate isSanitizer(DataFlow::Node node) { node instanceof TaintedPath::Sanitizer }
@@ -54,10 +54,10 @@ class TaintedPathAtmConfig extends AtmConfig {
5454
private class BarrierGuardNodeAsSanitizerGuardNode extends TaintTracking::LabeledSanitizerGuardNode instanceof TaintedPath::BarrierGuardNode
5555
{
5656
override predicate sanitizes(boolean outcome, Expr e) {
57-
blocks(outcome, e) or blocks(outcome, e, _)
57+
this.blocks(outcome, e) or this.blocks(outcome, e, _)
5858
}
5959

6060
override predicate sanitizes(boolean outcome, Expr e, DataFlow::FlowLabel label) {
61-
sanitizes(outcome, e) and exists(label)
61+
this.sanitizes(outcome, e) and exists(label)
6262
}
6363
}

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/Labels.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ newtype TEndpointLabel =
1313
abstract class EndpointLabel extends TEndpointLabel {
1414
abstract string getEncoding();
1515

16-
string toString() { result = getEncoding() }
16+
string toString() { result = this.getEncoding() }
1717
}
1818

1919
class SinkLabel extends EndpointLabel, TSinkLabel {

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/Queries.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ newtype TQuery =
1515
abstract class Query extends TQuery {
1616
abstract string getName();
1717

18-
string toString() { result = getName() }
18+
string toString() { result = this.getName() }
1919
}
2020

2121
class NosqlInjectionQuery extends Query, TNosqlInjectionQuery {

0 commit comments

Comments
 (0)