Skip to content

Commit dcc1278

Browse files
committed
PS: Make remote flow sources flow sources.
1 parent fa3fc4a commit dcc1278

File tree

1 file changed

+11
-3
lines changed
  • powershell/ql/lib/semmle/code/powershell/dataflow/flowsources

1 file changed

+11
-3
lines changed

powershell/ql/lib/semmle/code/powershell/dataflow/flowsources/Remote.qll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
private import semmle.code.powershell.dataflow.internal.DataFlowPublic as DataFlow
77
// Need to import since frameworks can extend `RemoteFlowSource::Range`
88
private import semmle.code.powershell.Frameworks
9+
private import semmle.code.powershell.dataflow.flowsources.FlowSources
910

1011
/**
1112
* A data flow source of remote user input.
1213
*
1314
* Extend this class to refine existing API models. If you want to model new APIs,
1415
* extend `RemoteFlowSource::Range` instead.
1516
*/
16-
class RemoteFlowSource extends DataFlow::Node instanceof RemoteFlowSource::Range {
17-
/** Gets a string that describes the type of this remote flow source. */
18-
string getSourceType() { result = super.getSourceType() }
17+
class RemoteFlowSource extends SourceNode instanceof RemoteFlowSource::Range {
18+
override string getSourceType() { result = "remote flow source" }
19+
20+
override string getThreatModel() { result = "remote" }
1921
}
2022

2123
/** Provides a class for modeling new sources of remote user input. */
@@ -31,3 +33,9 @@ module RemoteFlowSource {
3133
abstract string getSourceType();
3234
}
3335
}
36+
37+
private class ExternalRemoteFlowSource extends RemoteFlowSource::Range {
38+
ExternalRemoteFlowSource() { this = ModelOutput::getASourceNode("remote", _).asSource() }
39+
40+
override string getSourceType() { result = "remote flow" }
41+
}

0 commit comments

Comments
 (0)