mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
JS: Add ThreatModelSource#isCilentSideSource()
This commit is contained in:
@@ -26,6 +26,11 @@ class ThreatModelSource extends DataFlow::Node instanceof ThreatModelSource::Ran
|
||||
|
||||
/** Gets a string that describes the type of this threat-model source. */
|
||||
string getSourceType() { result = super.getSourceType() }
|
||||
|
||||
/**
|
||||
* Holds if this is a source of data that is specific to the web browser environment.
|
||||
*/
|
||||
predicate isClientSideSource() { super.isClientSideSource() }
|
||||
}
|
||||
|
||||
/** Provides a class for modeling new sources for specific threat-models. */
|
||||
@@ -48,6 +53,11 @@ module ThreatModelSource {
|
||||
|
||||
/** Gets a string that describes the type of this threat-model source. */
|
||||
abstract string getSourceType();
|
||||
|
||||
/**
|
||||
* Holds if this is a source of data that is specific to the web browser environment.
|
||||
*/
|
||||
predicate isClientSideSource() { this.getThreatModel() = "view-component-input" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,12 +24,18 @@ private module Cached {
|
||||
|
||||
/**
|
||||
* A source of remote input in a web browser environment.
|
||||
*
|
||||
* Note that this does not include `view-component-input` sources even if that threat model has been enabled by the user.
|
||||
* Consider using the predicate `ThreatModelSource#isClientSideSource()` to check for a broader class of client-side sources.
|
||||
*/
|
||||
cached
|
||||
abstract class ClientSideRemoteFlowSource extends RemoteFlowSource {
|
||||
/** Gets a string indicating what part of the browser environment this was derived from. */
|
||||
cached
|
||||
abstract ClientSideRemoteFlowKind getKind();
|
||||
|
||||
cached
|
||||
final override predicate isClientSideSource() { any() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user