Skip to content

Commit 6aa4c5c

Browse files
committed
C#: Fix a bad join
1 parent 553c09a commit 6aa4c5c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ import semmle.code.csharp.frameworks.system.Web
1616
import semmle.code.csharp.frameworks.system.web.Helpers
1717
import semmle.code.csharp.frameworks.system.web.Mvc
1818

19+
private Method getAValidatingMethod() {
20+
result = any(AntiForgeryClass a).getValidateMethod()
21+
or
22+
result.calls(getAValidatingMethod())
23+
}
24+
1925
/** An `AuthorizationFilter` that calls the `AntiForgery.Validate` method. */
2026
class AntiForgeryAuthorizationFilter extends AuthorizationFilter {
21-
AntiForgeryAuthorizationFilter() {
22-
this.getOnAuthorizationMethod().calls*(any(AntiForgeryClass a).getValidateMethod())
23-
}
27+
AntiForgeryAuthorizationFilter() { this.getOnAuthorizationMethod() = getAValidatingMethod() }
2428
}
2529

2630
/**

0 commit comments

Comments
 (0)