Skip to content

Commit b30bc5e

Browse files
committed
Allow MaD barriers relating to ExternalLocationSink
1 parent 004d40e commit b30bc5e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import csharp
66
private import semmle.code.csharp.security.dataflow.flowsources.Remote
7+
private import semmle.code.csharp.dataflow.internal.ExternalFlow
78
private import semmle.code.csharp.frameworks.system.Web
89
private import semmle.code.csharp.security.SensitiveActions
910
private import semmle.code.csharp.security.dataflow.flowsinks.ExternalLocationSink
@@ -62,3 +63,5 @@ class ProtectSanitizer extends Sanitizer {
6263
* An external location sink.
6364
*/
6465
class ExternalSink extends Sink instanceof ExternalLocationSink { }
66+
67+
private class ExternalSanitizer extends Sanitizer instanceof ExternalLocationSanitizer { }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ private class PrivateDataSource extends Source {
4646
}
4747

4848
private class ExternalLocation extends Sink instanceof ExternalLocationSink { }
49+
50+
private class ExternalSanitizer extends Sanitizer instanceof ExternalLocationSanitizer { }

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,11 @@ class LocalFileOutputSink extends ExternalLocationSink {
126126
)
127127
}
128128
}
129+
130+
/**
131+
* A sanitizer for writing data to locations that are external to the
132+
* application, defined through Models as Data.
133+
*/
134+
class ExternalLocationSanitizer extends DataFlow::Node {
135+
ExternalLocationSanitizer() { barrierNode(this, "file-content-store") }
136+
}

0 commit comments

Comments
 (0)