File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
csharp/ql/lib/semmle/code/csharp
security/dataflow/flowsources Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ module CsvValidation {
383
383
or
384
384
exists ( string row , string kind | sourceModel ( row ) |
385
385
kind = row .splitAt ( ";" , 7 ) and
386
- not kind = "local" and
386
+ not kind = [ "local" , "file" ] and
387
387
msg = "Invalid kind \"" + kind + "\" in source model."
388
388
)
389
389
}
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ class SystemIOMemoryStreamClass extends SystemIOClass {
179
179
}
180
180
}
181
181
182
+ /** Data flow for `System.IO.MemoryStream`. */
182
183
private class SystemIOMemoryStreamFlowModelCsv extends SummaryModelCsv {
183
184
override predicate row ( string row ) {
184
185
row =
@@ -192,3 +193,17 @@ private class SystemIOMemoryStreamFlowModelCsv extends SummaryModelCsv {
192
193
]
193
194
}
194
195
}
196
+
197
+ /** Sources for `System.IO.FileStream`. */
198
+ private class SystemIOFileStreamSourceModelCsv extends SourceModelCsv {
199
+ override predicate row ( string row ) {
200
+ row = "System.IO;FileStream;false;FileStream;;;Argument[Qualifier];file;manual"
201
+ }
202
+ }
203
+
204
+ /** Data flow for `System.IO.StreamReader`. */
205
+ private class SystemIOStreamSummaryModelCsv extends SummaryModelCsv {
206
+ override predicate row ( string row ) {
207
+ row = "System.IO;StreamReader;false;StreamReader;;;Argument[0];Argument[Qualifier];taint;manual"
208
+ }
209
+ }
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
import csharp
6
+ private import semmle.code.csharp.dataflow.ExternalFlow
6
7
private import semmle.code.csharp.frameworks.system.data.Common
7
8
private import semmle.code.csharp.frameworks.system.data.Entity
8
9
private import semmle.code.csharp.frameworks.EntityFramework
@@ -55,3 +56,8 @@ class ORMMappedProperty extends StoredFlowSource {
55
56
this instanceof NHibernate:: StoredFlowSource
56
57
}
57
58
}
59
+
60
+ /** A file stream source is considered a stored flow source. */
61
+ class FileStreamStoredFlowSource extends StoredFlowSource {
62
+ FileStreamStoredFlowSource ( ) { sourceNode ( this , "file" ) }
63
+ }
You can’t perform that action at this time.
0 commit comments