Skip to content

Commit 8ae64e9

Browse files
authored
Merge pull request #15929 from egregius313/egregius313/csharp/mad/source-node-clases-for-models
C#: Add classes extending `SourceNode` for local and stored source models
2 parents 693c28a + 71cf948 commit 8ae64e9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/Local.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ abstract class EnvironmentVariableSource extends LocalFlowSource {
4040
override string getSourceType() { result = "environment variable" }
4141
}
4242

43+
private class ExternalEnvironmentVariableSource extends EnvironmentVariableSource {
44+
ExternalEnvironmentVariableSource() { sourceNode(this, "environment") }
45+
}
46+
4347
/**
4448
* A dataflow source that represents the access of a command line argument.
4549
*/
@@ -49,6 +53,10 @@ abstract class CommandLineArgumentSource extends LocalFlowSource {
4953
override string getSourceType() { result = "command line argument" }
5054
}
5155

56+
private class ExternalCommandLineArgumentSource extends CommandLineArgumentSource {
57+
ExternalCommandLineArgumentSource() { sourceNode(this, "command-line") }
58+
}
59+
5260
/**
5361
* A data flow source that represents the parameters of the `Main` method of a program.
5462
*/

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/Stored.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ deprecated class ORMMappedProperty extends DataFlow::Node {
7373
}
7474
}
7575

76+
private class ExternalDatabaseInputSource extends DatabaseInputSource {
77+
ExternalDatabaseInputSource() { sourceNode(this, "database") }
78+
}
79+
7680
/** A file stream source is considered a stored flow source. */
7781
class FileStreamStoredFlowSource extends StoredFlowSource {
7882
FileStreamStoredFlowSource() { sourceNode(this, "file") }

0 commit comments

Comments
 (0)