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

This commit is contained in:
Michael Nebel
2021-12-09 15:30:05 +01:00
parent 07a4f5f748
commit 1cd37dddf5
2 changed files with 12 additions and 16 deletions

View File

@@ -1999,22 +1999,6 @@ class SystemWebHttpServerUtilityFlow extends LibraryTypeDataFlow, SystemWebHttpS
}
}
/** Data flow for `System.Net.WebUtility`. */
class SystemNetWebUtilityFlow extends LibraryTypeDataFlow, SystemNetWebUtility {
override predicate callableFlow(
CallableFlowSource source, CallableFlowSink sink, SourceDeclarationCallable c,
boolean preservesValue
) {
(
c = this.getAnHtmlEncodeMethod() or
c = this.getAnUrlEncodeMethod()
) and
source = TCallableFlowSourceArg(0) and
sink = TCallableFlowSinkReturn() and
preservesValue = false
}
}
/**
* Custom flow through `StringValues` library class.
*/

View File

@@ -28,6 +28,18 @@ class SystemNetWebUtility extends SystemNetClass {
Method getAnUrlEncodeMethod() { result = this.getAMethod("UrlEncode") }
}
/** Data flow for `System.Net.WebUtility`. */
private class SystemNetWebUtilityFlowModelCsv extends SummaryModelCsv {
override predicate row(string row) {
row =
[
"System.Net;WebUtility;false;HtmlEncode;(System.String);;Argument[0];ReturnValue;taint",
"System.Net;WebUtility;false;HtmlEncode;(System.String,System.IO.TextWriter);;Argument[0];ReturnValue;taint",
"System.Net;WebUtility;false;UrlEncode;(System.String);;Argument[0];ReturnValue;taint"
]
}
}
/** The `System.Net.HttpListenerResponse` class. */
class SystemNetHttpListenerResponseClass extends SystemNetClass {
SystemNetHttpListenerResponseClass() { this.hasName("HttpListenerResponse") }