Skip to content

Commit

Permalink
C#: Fix a bad join
Browse files Browse the repository at this point in the history
  • Loading branch information
hvitved committed Apr 23, 2024
1 parent 553c09a commit 6aa4c5c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ import semmle.code.csharp.frameworks.system.Web
import semmle.code.csharp.frameworks.system.web.Helpers
import semmle.code.csharp.frameworks.system.web.Mvc

private Method getAValidatingMethod() {
result = any(AntiForgeryClass a).getValidateMethod()
or
result.calls(getAValidatingMethod())
}

/** An `AuthorizationFilter` that calls the `AntiForgery.Validate` method. */
class AntiForgeryAuthorizationFilter extends AuthorizationFilter {
AntiForgeryAuthorizationFilter() {
this.getOnAuthorizationMethod().calls*(any(AntiForgeryClass a).getValidateMethod())
}
AntiForgeryAuthorizationFilter() { this.getOnAuthorizationMethod() = getAValidatingMethod() }
}

/**
Expand Down

0 comments on commit 6aa4c5c

Please sign in to comment.