File tree Expand file tree Collapse file tree
csharp/ql/lib/semmle/code/csharp
security/dataflow/flowsources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ module CsvValidation {
383383 or
384384 exists ( string row , string kind | sourceModel ( row ) |
385385 kind = row .splitAt ( ";" , 7 ) and
386- not kind = "local" and
386+ not kind = [ "local" , "file" ] and
387387 msg = "Invalid kind \"" + kind + "\" in source model."
388388 )
389389 }
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ class SystemIOMemoryStreamClass extends SystemIOClass {
179179 }
180180}
181181
182+ /** Data flow for `System.IO.MemoryStream`. */
182183private class SystemIOMemoryStreamFlowModelCsv extends SummaryModelCsv {
183184 override predicate row ( string row ) {
184185 row =
@@ -192,3 +193,17 @@ private class SystemIOMemoryStreamFlowModelCsv extends SummaryModelCsv {
192193 ]
193194 }
194195}
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 33 */
44
55import csharp
6+ private import semmle.code.csharp.dataflow.ExternalFlow
67private import semmle.code.csharp.frameworks.system.data.Common
78private import semmle.code.csharp.frameworks.system.data.Entity
89private import semmle.code.csharp.frameworks.EntityFramework
@@ -55,3 +56,8 @@ class ORMMappedProperty extends StoredFlowSource {
5556 this instanceof NHibernate:: StoredFlowSource
5657 }
5758}
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