From 84e93e2dc53ca9a77d4a14231c71c841176c270e Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 20 Jun 2025 11:49:30 +0200 Subject: [PATCH] C#: Add another test for `MissingAccessControl.ql` --- .../MissingAccessControl/MVCTests/ProfileController.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs index 9c20313b84b..84af3b50d1f 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs @@ -41,6 +41,14 @@ public class ProfileController : Controller doThings(); return View(); } + + // GOOD: The Authorize attribute is used. + [Authorize("foo")] + public ActionResult Delete5(int id) + { + doThings(); + return View(); + } } [Authorize]