Skip to content

Commit 9639dca

Browse files
committed
C#: Consider all properties of ASP.NET Core like objects to also be sources of tainted data.
1 parent f7cc46b commit 9639dca

File tree

1 file changed

+13
-1
lines changed
  • csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources

1 file changed

+13
-1
lines changed

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/Remote.qll

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ class ActionMethodParameter extends RemoteFlowSource, DataFlow::ParameterNode {
171171
/** A data flow source of remote user input (ASP.NET Core). */
172172
abstract class AspNetCoreRemoteFlowSource extends RemoteFlowSource { }
173173

174+
/**
175+
* Data flow for AST.NET Core.
176+
*
177+
* Flow is defined from any ASP.NET Core remote source object to any of its member
178+
* properties.
179+
*/
180+
private class AspNetCoreRemoteFlowSourceMember extends TaintTracking::TaintedMember {
181+
AspNetCoreRemoteFlowSourceMember() {
182+
this.getDeclaringType() = any(AspNetCoreRemoteFlowSource source).getType()
183+
}
184+
}
185+
174186
/** A data flow source of remote user input (ASP.NET query collection). */
175187
class AspNetCoreQueryRemoteFlowSource extends AspNetCoreRemoteFlowSource, DataFlow::ExprNode {
176188
AspNetCoreQueryRemoteFlowSource() {
@@ -196,7 +208,7 @@ class AspNetCoreQueryRemoteFlowSource extends AspNetCoreRemoteFlowSource, DataFl
196208
}
197209

198210
/** A parameter to a `Mvc` controller action method, viewed as a source of remote user input. */
199-
class AspNetCoreActionMethodParameter extends RemoteFlowSource, DataFlow::ParameterNode {
211+
class AspNetCoreActionMethodParameter extends AspNetCoreRemoteFlowSource, DataFlow::ParameterNode {
200212
AspNetCoreActionMethodParameter() {
201213
exists(Parameter p |
202214
p = this.getParameter() and

0 commit comments

Comments
 (0)