Skip to content

Commit 14fec96

Browse files
committed
C#: Also support typeof expressions.
1 parent c272bf9 commit 14fec96

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

csharp/ql/src/Security Features/CWE-352/MissingAntiForgeryTokenValidation.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ predicate hasGlobalAspNetMvcAntiForgeryFilter(Compilation compilation) {
5656
addGlobalFilter.getArgument(0).getType() instanceof
5757
AspNetCore::AutoValidateAntiforgeryTokenAttribute or
5858
addGlobalFilter.getTarget().(ConstructedGeneric).getTypeArgument(0) instanceof
59+
AspNetCore::AutoValidateAntiforgeryTokenAttribute or
60+
addGlobalFilter.getArgument(0).(TypeofExpr).getTypeAccess().getTarget() instanceof
5961
AspNetCore::AutoValidateAntiforgeryTokenAttribute
6062
) and
6163
// The filter is added in an ASP.NET Core registration call, which is provided as a lambda argument

0 commit comments

Comments
 (0)