@@ -30,6 +30,9 @@ private module Cached {
3030 */
3131 cached
3232 abstract class ClientSideRemoteFlowSource extends RemoteFlowSource {
33+ cached
34+ override string getThreatModel ( ) { result = this .getKind ( ) }
35+
3336 /** Gets a string indicating what part of the browser environment this was derived from. */
3437 cached
3538 abstract ClientSideRemoteFlowKind getKind ( ) ;
@@ -43,35 +46,41 @@ import Cached
4346
4447/**
4548 * A type of remote flow source that is specific to the browser environment.
49+ *
50+ * The underlying string also corresponds to a source kind and threat model kind.
4651 */
4752class ClientSideRemoteFlowKind extends string {
4853 ClientSideRemoteFlowKind ( ) {
49- this = [ "query" , "fragment" , "path" , "url" , "name" , "message-event" ]
54+ this =
55+ [
56+ "browser-url-query" , "browser-url-fragment" , "browser-url-path" , "browser-url" ,
57+ "browser-window-name" , "browser-message-event"
58+ ]
5059 }
5160
5261 /**
53- * Holds if this is the `query` kind, describing sources derived from the query parameters of the browser URL,
62+ * Holds if this is the `browser-url- query` kind, describing sources derived from the query parameters of the browser URL,
5463 * such as `location.search`.
5564 */
56- predicate isQuery ( ) { this = "query" }
65+ predicate isQuery ( ) { this = "browser-url- query" }
5766
5867 /**
59- * Holds if this is the `frgament ` kind, describing sources derived from the fragment part of the browser URL,
68+ * Holds if this is the `browser-url-fragment ` kind, describing sources derived from the fragment part of the browser URL,
6069 * such as `location.hash`.
6170 */
62- predicate isFragment ( ) { this = "fragment" }
71+ predicate isFragment ( ) { this = "browser-url- fragment" }
6372
6473 /**
65- * Holds if this is the `path` kind, describing sources derived from the pathname of the browser URL,
74+ * Holds if this is the `browser-url- path` kind, describing sources derived from the pathname of the browser URL,
6675 * such as `location.pathname`.
6776 */
68- predicate isPath ( ) { this = "path" }
77+ predicate isPath ( ) { this = "browser-url- path" }
6978
7079 /**
71- * Holds if this is the `url` kind, describing sources derived from the browser URL,
80+ * Holds if this is the `browser- url` kind, describing sources derived from the browser URL,
7281 * where the untrusted part of the URL is prefixed by trusted data, such as the scheme and hostname.
7382 */
74- predicate isUrl ( ) { this = "url" }
83+ predicate isUrl ( ) { this = "browser- url" }
7584
7685 /** Holds if this is the `query` or `fragment` kind. */
7786 predicate isQueryOrFragment ( ) { this .isQuery ( ) or this .isFragment ( ) }
@@ -83,13 +92,13 @@ class ClientSideRemoteFlowKind extends string {
8392 predicate isPathOrUrl ( ) { this .isPath ( ) or this .isUrl ( ) }
8493
8594 /** Holds if this is the `name` kind, describing sources derived from the window name, such as `window.name`. */
86- predicate isWindowName ( ) { this = "name" }
95+ predicate isWindowName ( ) { this = "browser-window- name" }
8796
8897 /**
89- * Holds if this is the `message-event` kind, describing sources derived from cross-window message passing,
98+ * Holds if this is the `browser- message-event` kind, describing sources derived from cross-window message passing,
9099 * such as `event` in `window.onmessage = event => {...}`.
91100 */
92- predicate isMessageEvent ( ) { this = "message-event" }
101+ predicate isMessageEvent ( ) { this = "browser- message-event" }
93102}
94103
95104/**
0 commit comments