We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 553c09a commit 6aa4c5cCopy full SHA for 6aa4c5c
1 file changed
csharp/ql/src/Security Features/CWE-352/MissingAntiForgeryTokenValidation.ql
@@ -16,11 +16,15 @@ import semmle.code.csharp.frameworks.system.Web
16
import semmle.code.csharp.frameworks.system.web.Helpers
17
import semmle.code.csharp.frameworks.system.web.Mvc
18
19
+private Method getAValidatingMethod() {
20
+ result = any(AntiForgeryClass a).getValidateMethod()
21
+ or
22
+ result.calls(getAValidatingMethod())
23
+}
24
+
25
/** An `AuthorizationFilter` that calls the `AntiForgery.Validate` method. */
26
class AntiForgeryAuthorizationFilter extends AuthorizationFilter {
- AntiForgeryAuthorizationFilter() {
- this.getOnAuthorizationMethod().calls*(any(AntiForgeryClass a).getValidateMethod())
- }
27
+ AntiForgeryAuthorizationFilter() { this.getOnAuthorizationMethod() = getAValidatingMethod() }
28
}
29
30
/**
0 commit comments