Skip to content

Commit 0e0c3e3

Browse files
committed
C#: Convert System.Web.HttpServerUtility flow to CSV format.
1 parent 6301e72 commit 0e0c3e3

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

csharp/ql/lib/semmle/code/csharp/dataflow/LibraryTypeDataFlow.qll

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,22 +1983,6 @@ class SystemWebHttpUtilityFlow extends LibraryTypeDataFlow, SystemWebHttpUtility
19831983
}
19841984
}
19851985

1986-
/** Data flow for `System.Web.HttpServerUtility`. */
1987-
class SystemWebHttpServerUtilityFlow extends LibraryTypeDataFlow, SystemWebHttpServerUtility {
1988-
override predicate callableFlow(
1989-
CallableFlowSource source, CallableFlowSink sink, SourceDeclarationCallable c,
1990-
boolean preservesValue
1991-
) {
1992-
(
1993-
c = this.getAnHtmlEncodeMethod() or
1994-
c = this.getAnUrlEncodeMethod()
1995-
) and
1996-
source = TCallableFlowSourceArg(0) and
1997-
sink = TCallableFlowSinkReturn() and
1998-
preservesValue = false
1999-
}
2000-
}
2001-
20021986
/**
20031987
* Custom flow through `StringValues` library class.
20041988
*/

csharp/ql/lib/semmle/code/csharp/frameworks/system/Web.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ class SystemWebHttpServerUtility extends SystemWebClass {
175175
Method getAnUrlEncodeMethod() { result = this.getAMethod("UrlEncode") }
176176
}
177177

178+
/** Data flow for `System.Web.HttpServerUtility`. */
179+
private class SystemWebHttpServerUtilityFlowModelCsv extends SummaryModelCsv {
180+
override predicate row(string row) {
181+
row =
182+
[
183+
"System.Web;HttpServerUtility;false;HtmlEncode;(System.String);;Argument[0];ReturnValue;taint",
184+
"System.Web;HttpServerUtility;false;UrlEncode;(System.String);;Argument[0];ReturnValue;taint"
185+
]
186+
}
187+
}
188+
178189
/** The `System.Web.HttpUtility` class. */
179190
class SystemWebHttpUtility extends SystemWebClass {
180191
SystemWebHttpUtility() { this.hasName("HttpUtility") }

0 commit comments

Comments
 (0)