C#: Convert System.Web.HttpServerUtility flow to CSV format.

This commit is contained in:
Michael Nebel 2021-12-09 15:53:42 +01:00
Родитель 6301e726ee
Коммит 0e0c3e3937
2 изменённых файлов: 11 добавлений и 16 удалений

Просмотреть файл

@ -1983,22 +1983,6 @@ class SystemWebHttpUtilityFlow extends LibraryTypeDataFlow, SystemWebHttpUtility
}
}
/** Data flow for `System.Web.HttpServerUtility`. */
class SystemWebHttpServerUtilityFlow extends LibraryTypeDataFlow, SystemWebHttpServerUtility {
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.
*/

Просмотреть файл

@ -175,6 +175,17 @@ class SystemWebHttpServerUtility extends SystemWebClass {
Method getAnUrlEncodeMethod() { result = this.getAMethod("UrlEncode") }
}
/** Data flow for `System.Web.HttpServerUtility`. */
private class SystemWebHttpServerUtilityFlowModelCsv extends SummaryModelCsv {
override predicate row(string row) {
row =
[
"System.Web;HttpServerUtility;false;HtmlEncode;(System.String);;Argument[0];ReturnValue;taint",
"System.Web;HttpServerUtility;false;UrlEncode;(System.String);;Argument[0];ReturnValue;taint"
]
}
}
/** The `System.Web.HttpUtility` class. */
class SystemWebHttpUtility extends SystemWebClass {
SystemWebHttpUtility() { this.hasName("HttpUtility") }