C#: Convert System.Net.Cookie flow to CSV format.

This commit is contained in:
Michael Nebel
2021-12-09 12:08:20 +01:00
parent 03fb244545
commit d804893a49
2 changed files with 8 additions and 18 deletions

View File

@@ -1330,24 +1330,6 @@ class IDictionaryFlow extends LibraryTypeDataFlow, RefType {
}
}
/** Data flow for `System.Net.Cookie`. */
class SystemNetCookieFlow extends LibraryTypeDataFlow, SystemNetCookieClass {
override predicate callableFlow(
CallableFlowSource source, CallableFlowSink sink, SourceDeclarationCallable c,
boolean preservesValue
) {
exists(Property p |
this.propertyFlow(p) and
source = TCallableFlowSourceQualifier() and
sink = TCallableFlowSinkReturn() and
c = p.getGetter()
) and
preservesValue = false
}
private predicate propertyFlow(Property p) { p = this.getValueProperty() }
}
/** Data flow for `System.Net.IPHostEntry`. */
class SystemNetIPHostEntryFlow extends LibraryTypeDataFlow, SystemNetIPHostEntryClass {
override predicate callableFlow(

View File

@@ -2,6 +2,7 @@
import csharp
private import semmle.code.csharp.frameworks.System
private import semmle.code.csharp.dataflow.ExternalFlow
/** The `System.Net` namespace. */
class SystemNetNamespace extends Namespace {
@@ -66,3 +67,10 @@ class SystemNetCookieClass extends SystemNetClass {
/** Gets the `Value` property. */
Property getValueProperty() { result = this.getProperty("Value") }
}
/** Data flow for `System.Net.Cookie`. */
private class SystemNetCookieClassFlowModelCsv extends SummaryModelCsv {
override predicate row(string row) {
row = "System.Net;Cookie;false;get_Value;();;Argument[-1];ReturnValue;taint"
}
}