File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
csharp/ql/src/semmle/code/csharp Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ private module Frameworks {
87
87
private import semmle.code.csharp.security.dataflow.flowsources.Local
88
88
private import semmle.code.csharp.security.dataflow.flowsinks.Html
89
89
private import semmle.code.csharp.dataflow.LibraryTypeDataFlow
90
+ private import semmle.code.csharp.security.dataflow.XSS
90
91
}
91
92
92
93
/**
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module XSS {
16
16
import semmle.code.csharp.security.dataflow.flowsources.Remote
17
17
private import semmle.code.csharp.dataflow.DataFlow2
18
18
private import semmle.code.csharp.dataflow.TaintTracking2
19
+ private import semmle.code.csharp.dataflow.ExternalFlow
19
20
20
21
/**
21
22
* Holds if there is tainted flow from `source` to `sink` that may lead to a
@@ -119,6 +120,10 @@ module XSS {
119
120
string explanation ( ) { none ( ) }
120
121
}
121
122
123
+ private class ExternalXssSink extends Sink {
124
+ ExternalXssSink ( ) { sinkNode ( this , "xss" ) }
125
+ }
126
+
122
127
/**
123
128
* A data flow source for cross-site scripting (XSS) vulnerabilities.
124
129
*/
@@ -406,12 +411,9 @@ module XSS {
406
411
/**
407
412
* An expression passed as the `content` argument to the constructor of `StringContent`.
408
413
*/
409
- private class StringContent extends Sink {
410
- StringContent ( ) {
411
- this .getExpr ( ) =
412
- any ( ObjectCreation oc |
413
- oc .getTarget ( ) .getDeclaringType ( ) .hasQualifiedName ( "System.Net.Http" , "StringContent" )
414
- ) .getArgumentForName ( "content" )
414
+ private class StringContentSinkModelCsv extends SinkModelCsv {
415
+ override predicate row ( string row ) {
416
+ row = [ "System.Net.Http;StringContent;false;StringContent;;;Argument[0];xss" ]
415
417
}
416
418
}
417
419
}
You can’t perform that action at this time.
0 commit comments