Skip to content

Commit 381ea93

Browse files
authored
Merge pull request #17424 from RasmusWL/active-threat-model-source
Go/Java/C#: Rename `ThreatModelFlowSource` to `ActiveThreatModelSource`
2 parents d7fb7ab + 63c3a71 commit 381ea93

File tree

141 files changed

+216
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+216
-183
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: deprecated
3+
---
4+
* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated.

csharp/ql/lib/semmle/code/csharp/security/auth/InsecureDirectObjectReferenceQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private predicate needsChecks(ActionMethod m) { m.isEdit() and not m.isAdmin() }
1818
* that may indicate that it's used as the ID for some resource
1919
*/
2020
private predicate hasIdParameter(ActionMethod m) {
21-
exists(ThreatModelFlowSource src | src.getEnclosingCallable() = m |
21+
exists(ActiveThreatModelSource src | src.getEnclosingCallable() = m |
2222
src.asParameter().getName().toLowerCase().matches(["%id", "%idx"])
2323
or
2424
// handle cases like `Request.QueryString["Id"]`

csharp/ql/lib/semmle/code/csharp/security/dataflow/CodeInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
5555
deprecated class LocalSource extends DataFlow::Node instanceof LocalFlowSource { }
5656

5757
/** A source supported by the current threat model. */
58-
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
58+
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
5959

6060
private class SimpleTypeSanitizer extends Sanitizer, SimpleTypeSanitizedExpr { }
6161

csharp/ql/lib/semmle/code/csharp/security/dataflow/CommandInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module CommandInjection = TaintTracking::Global<CommandInjectionConfig>;
5757
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
5858

5959
/** A source supported by the current threat model. */
60-
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
60+
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
6161

6262
/** Command Injection sinks defined through Models as Data. */
6363
private class ExternalCommandInjectionExprSink extends Sink {

csharp/ql/lib/semmle/code/csharp/security/dataflow/ConditionalBypassQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module ConditionalBypass = TaintTracking::Global<ConditionalBypassConfig>;
5454
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
5555

5656
/** A source supported by the current threat model. */
57-
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
57+
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
5858

5959
/** The result of a reverse dns may be user-controlled. */
6060
class ReverseDnsSource extends Source {

csharp/ql/lib/semmle/code/csharp/security/dataflow/ExternalAPIsQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ class ExternalApiDataNode extends DataFlow::Node {
7373
}
7474
}
7575

76-
/** A configuration for tracking flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s. */
76+
/** A configuration for tracking flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s. */
7777
private module RemoteSourceToExternalApiConfig implements DataFlow::ConfigSig {
78-
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
78+
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
7979

8080
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
8181
}
8282

83-
/** A module for tracking flow from `ThreatModelFlowSource`s to `ExternalApiDataNode`s. */
83+
/** A module for tracking flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s. */
8484
module RemoteSourceToExternalApi = TaintTracking::Global<RemoteSourceToExternalApiConfig>;
8585

8686
/** A node representing untrusted data being passed to an external API. */

csharp/ql/lib/semmle/code/csharp/security/dataflow/LDAPInjectionQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module LdapInjection = TaintTracking::Global<LdapInjectionConfig>;
6060
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
6161

6262
/** A source supported by the current threat model. */
63-
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
63+
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
6464

6565
/** LDAP sinks defined through Models as Data. */
6666
private class ExternalLdapExprSink extends Sink {

csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private module LogForgingConfig implements DataFlow::ConfigSig {
4343
module LogForging = TaintTracking::Global<LogForgingConfig>;
4444

4545
/** A source of remote user input. */
46-
private class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
46+
private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
4747

4848
private class HtmlSanitizer extends Sanitizer {
4949
HtmlSanitizer() { this.asExpr() instanceof HtmlSanitizedExpr }

csharp/ql/lib/semmle/code/csharp/security/dataflow/MissingXMLValidationQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private module MissingXmlValidationConfig implements DataFlow::ConfigSig {
4848
module MissingXmlValidation = TaintTracking::Global<MissingXmlValidationConfig>;
4949

5050
/**
51-
* DEPRECATED: Use `ThreatModelFlowSource` instead.
51+
* DEPRECATED: Use `ActiveThreatModelSource` instead.
5252
*
5353
* A source of remote user input.
5454
*/
@@ -57,7 +57,7 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
5757
/**
5858
* A source supported by the current threat model.
5959
*/
60-
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
60+
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
6161

6262
/**
6363
* The input argument to a call to `XmlReader.Create` where the input will not be validated against

csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module ReDoS = TaintTracking::Global<ReDoSConfig>;
4949
deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource { }
5050

5151
/** A source supported by the current threat model. */
52-
class ThreatModelSource extends Source instanceof ThreatModelFlowSource { }
52+
class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
5353

5454
/**
5555
* An expression that represents a regular expression with potential exponential behavior.

0 commit comments

Comments
 (0)