Skip to content

Commit 31d4d0c

Browse files
committed
Move getSourceType to SourceNode
1 parent 7577266 commit 31d4d0c

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ module EntityFramework {
4949
StoredFlowSource() {
5050
this.asExpr() = any(PropertyRead read | read.getTarget() instanceof MappedProperty)
5151
}
52+
53+
override string getSourceType() { result = "ORM mapped property" }
5254
}
5355

5456
private class EFClass extends Class {

csharp/ql/lib/semmle/code/csharp/frameworks/NHibernate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ module NHibernate {
9191
StoredFlowSource() {
9292
this.asExpr() = any(PropertyRead read | read.getTarget() instanceof MappedProperty)
9393
}
94+
95+
override string getSourceType() { result = "ORM mapped property" }
9496
}
9597

9698
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ abstract class SourceNode extends DataFlow::Node {
1414
* Gets a string that represents the source kind with respect to threat modeling.
1515
*/
1616
abstract string getThreatModel();
17+
18+
/** Gets a string that describes the type of this flow source. */
19+
abstract string getSourceType();
1720
}
1821

1922
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ private import semmle.code.csharp.security.dataflow.flowsources.FlowSources
99

1010
/** A data flow source of local data. */
1111
abstract class LocalFlowSource extends SourceNode {
12-
/** Gets a string that describes the type of this local flow source. */
13-
abstract string getSourceType();
12+
override string getSourceType() { result = "local flow source" }
1413

1514
override string getThreatModel() { result = "local" }
1615
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ private import semmle.code.csharp.security.dataflow.flowsources.FlowSources
1717

1818
/** A data flow source of remote user input. */
1919
abstract class RemoteFlowSource extends SourceNode {
20-
/** Gets a string that describes the type of this remote flow source. */
21-
abstract string getSourceType();
20+
override string getSourceType() { result = "remote flow source" }
2221

2322
override string getThreatModel() { result = "remote" }
2423
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ private import semmle.code.csharp.security.dataflow.flowsources.FlowSources
1313

1414
/** A data flow source of stored user input. */
1515
abstract class StoredFlowSource extends SourceNode {
16+
// override string getSourceType() { result = "stored flow source" }
1617
override string getThreatModel() { result = "local" }
1718
}
1819

@@ -21,6 +22,8 @@ abstract class StoredFlowSource extends SourceNode {
2122
*/
2223
abstract class DatabaseInputSource extends StoredFlowSource {
2324
override string getThreatModel() { result = "database" }
25+
26+
override string getSourceType() { result = "database input" }
2427
}
2528

2629
/**
@@ -76,4 +79,6 @@ class FileStreamStoredFlowSource extends StoredFlowSource {
7679
FileStreamStoredFlowSource() { sourceNode(this, "file") }
7780

7881
override string getThreatModel() { result = "file" }
82+
83+
override string getSourceType() { result = "file stream" }
7984
}

0 commit comments

Comments
 (0)