Skip to content

Commit 9f25c71

Browse files
Apply minor reveiw suggstions
1 parent 4967fe0 commit 9f25c71

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

csharp/ql/lib/semmle/code/csharp/security/auth/InsecureDirectObjectReferenceQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import ActionMethods
1212
// Other queries check that there are authorization checks in place for admin methods.
1313
private predicate needsChecks(ActionMethod m) { m.isEdit() and not m.isAdmin() }
1414

15-
private Expr getParentExpr(Expr ex) { result = ex.getParent() }
15+
private Expr getParentExpr(Expr ex) { result.getAChildExpr() = ex }
1616

1717
/**
1818
* Holds if `m` has a parameter or access a remote flow source
@@ -41,7 +41,7 @@ private predicate checksUser(ActionMethod m) {
4141

4242
/**
4343
* Holds if `m` is a method that modifies a particular resource based on
44-
* and ID provided by user input, but does not check anything based on the current user
44+
* an ID provided by user input, but does not check anything based on the current user
4545
* to determine if they should modify this resource.
4646
*/
4747
predicate hasInsecureDirectObjectReference(ActionMethod m) {

csharp/ql/src/Security Features/CWE-639/InsecureDirectObjectReference.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<overview>
66
<p>When an action method accepts an ID parameter used to control which resource (e.g. a comment, a user profile, etc)
77
is being accessed/modified, checks should me made to ensure that the current user is authorized to access that resource.
8-
Otherwise, an attacker could access an arbitrary resource by modifying the ID parameter.</p>
8+
Otherwise, an attacker could access an arbitrary resource by guessing the ID parameter.</p>
99

1010
</overview>
1111
<recommendation>

0 commit comments

Comments
 (0)