Skip to content

Commit 98485cb

Browse files
committed
Increase accuracy of user controlled data
1 parent 7de34e4 commit 98485cb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

csharp/ql/lib/ext/Microsoft.AspNetCore.Components.model.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ extensions:
33
pack: codeql/csharp-all
44
extensible: sourceModel
55
data:
6-
- ["Microsoft.AspNetCore.Components", "NavigationManager", True, "get_BaseUri", "", "", "ReturnValue", "remote", "manual"]
76
- ["Microsoft.AspNetCore.Components", "NavigationManager", True, "get_Uri", "", "", "ReturnValue", "remote", "manual"]
87
- ["Microsoft.AspNetCore.Components", "SupplyParameterFromFormAttribute", False, "", "", "Attribute.Getter", "ReturnValue", "remote", "manual"]
98
- ["Microsoft.AspNetCore.Components", "SupplyParameterFromQueryAttribute", False, "", "", "Attribute.Getter", "ReturnValue", "remote", "manual"]

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,15 @@ class AspNetCoreQueryRemoteFlowSource extends AspNetCoreRemoteFlowSource, DataFl
237237
t instanceof MicrosoftAspNetCoreHttpQueryCollection or
238238
t instanceof MicrosoftAspNetCoreHttpQueryString
239239
|
240-
this.getExpr().(Call).getTarget().getDeclaringType() = t or
241-
this.asExpr().(Access).getTarget().getDeclaringType() = t
240+
(
241+
this.getExpr().(Call).getTarget().getDeclaringType() = t or
242+
this.asExpr().(Access).getTarget().getDeclaringType() = t
243+
) and
244+
not this.asExpr()
245+
.(MemberAccess)
246+
.getQualifiedDeclaration()
247+
.hasFullyQualifiedName("Microsoft.AspNetCore.Http", "HttpRequest",
248+
["Method", "Scheme", "IsHttps", "Protocol"])
242249
)
243250
or
244251
exists(Call c |

0 commit comments

Comments
 (0)