Skip to content

Commit a53bf4d

Browse files
Apply doc review suggestions
1 parent c419e8d commit a53bf4d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

csharp/ql/src/Security Features/CWE-285/MVC.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public ActionResult Edit(int id) {
55
...
66
}
77

8-
// GOOD: The `Authorize` tag is used.
8+
// GOOD: The `Authorize` attribute is used.
99
[Authorize]
1010
public ActionResult Delete(int id) {
1111
...

csharp/ql/src/Security Features/CWE-285/MissingAccessControl.qhelp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
<overview>
77
<p>
8-
Sensitive actions, such as editing or deleting content, or accessing admin pages, should have authentication checks
9-
to ensure that they cannot be used by arbitrary users.
8+
Sensitive actions, such as editing or deleting content, or accessing admin pages, should have authorization checks
9+
to ensure that they cannot be used by malicious actors.
1010
</p>
1111

1212
</overview>
1313
<recommendation>
1414

1515
<p>
1616
Ensure that proper authorization checks are made for sensitive actions.
17-
For WebForms applications, the <code>authorazation</code> tag in <code>Web.config</code> XML files
17+
For WebForms applications, the <code>authorization</code> tag in <code>Web.config</code> XML files
1818
can be used to implement access control. The <code>System.Web.UI.Page.User</code> property can also be
19-
used to verify a user's roles.
19+
used to verify a user's role.
2020
For MVC applications, the <code>Authorize</code> attribute can be used to require authorization on specific
2121
action methods.
2222
</p>
@@ -25,30 +25,30 @@ action methods.
2525
<example>
2626

2727
<p>
28-
In the following WebForms example, the case marked BAD has no authorization checks; whereas the
28+
In the following WebForms example, the case marked BAD has no authorization checks whereas the
2929
case marked GOOD uses <code>User.IsInRole</code> to check for the user's role.
3030
</p>
3131

3232
<sample src="WebForms.cs" />
3333

3434
<p>
3535
The following <code>Web.config</code> file uses the <code>authorization</code> tag to deny access to anonymous users,
36-
in a <code>location</code>> tag to have it apply to a specific path.
36+
in a <code>location</code> tag to have that configuration apply to a specific path.
3737
</p>
3838

3939
<sample src="Web.config" />
4040

4141
<p>
4242
In the following MVC example, the case marked BAD has no authorization
43-
checks; whereas the case marked GOOD uses the <code>Authorize</code> attribute.
43+
checks whereas the case marked GOOD uses the <code>Authorize</code> attribute.
4444
</p>
4545

4646
<sample src="MVC.cs" />
4747

4848
</example>
4949
<references>
50-
<li><code>Page.User</code> Property - <a href="https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.page.user?view=netframework-4.8.1#system-web-ui-page-user">Microsoft Learn</a></li>
51-
<li>Control authorization permissions in an ASP.NET application - <a href="https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/aspnet/www-authentication-authorization/authorization-permissions">Microsoft Learn</a></li>
52-
<li>Simple authorization in ASP.NET Core - <a href="https://learn.microsoft.com/en-us/aspnet/core/security/authorization/simple?view=aspnetcore-7.0">Microsoft Learn</a></li>
50+
<li><code>Page.User</code> Property - <a href="https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.page.user?view=netframework-4.8.1#system-web-ui-page-user">Microsoft Learn</a>.</li>
51+
<li>Control authorization permissions in an ASP.NET application - <a href="https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/aspnet/www-authentication-authorization/authorization-permissions">Microsoft Learn</a>.</li>
52+
<li>Simple authorization in ASP.NET Core - <a href="https://learn.microsoft.com/en-us/aspnet/core/security/authorization/simple?view=aspnetcore-7.0">Microsoft Learn</a>.</li>
5353
</references>
5454
</qhelp>

csharp/ql/src/Security Features/CWE-285/MissingAccessControl.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Missing function level access control
3-
* @description Sensitive actions should have authorization checks to prevent them from being used by arbitrary users.
3+
* @description Sensitive actions should have authorization checks to prevent them from being used by malicious actors.
44
* @kind problem
55
* @problem.severity warning
66
* @security-severity 7.5

0 commit comments

Comments
 (0)