File tree 2 files changed +16
-0
lines changed
javascript/ql/lib/semmle/javascript
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class ThreatModelSource extends DataFlow::Node instanceof ThreatModelSource::Ran
26
26
27
27
/** Gets a string that describes the type of this threat-model source. */
28
28
string getSourceType ( ) { result = super .getSourceType ( ) }
29
+
30
+ /**
31
+ * Holds if this is a source of data that is specific to the web browser environment.
32
+ */
33
+ predicate isClientSideSource ( ) { super .isClientSideSource ( ) }
29
34
}
30
35
31
36
/** Provides a class for modeling new sources for specific threat-models. */
@@ -48,6 +53,11 @@ module ThreatModelSource {
48
53
49
54
/** Gets a string that describes the type of this threat-model source. */
50
55
abstract string getSourceType ( ) ;
56
+
57
+ /**
58
+ * Holds if this is a source of data that is specific to the web browser environment.
59
+ */
60
+ predicate isClientSideSource ( ) { this .getThreatModel ( ) = "view-component-input" }
51
61
}
52
62
}
53
63
Original file line number Diff line number Diff line change @@ -24,12 +24,18 @@ private module Cached {
24
24
25
25
/**
26
26
* A source of remote input in a web browser environment.
27
+ *
28
+ * Note that this does not include `view-component-input` sources even if that threat model has been enabled by the user.
29
+ * Consider using the predicate `ThreatModelSource#isClientSideSource()` to check for a broader class of client-side sources.
27
30
*/
28
31
cached
29
32
abstract class ClientSideRemoteFlowSource extends RemoteFlowSource {
30
33
/** Gets a string indicating what part of the browser environment this was derived from. */
31
34
cached
32
35
abstract ClientSideRemoteFlowKind getKind ( ) ;
36
+
37
+ cached
38
+ final override predicate isClientSideSource ( ) { any ( ) }
33
39
}
34
40
}
35
41
You can’t perform that action at this time.
0 commit comments