Skip to content

Commit

Permalink
Apply minor reveiw suggstions
Browse files Browse the repository at this point in the history
  • Loading branch information
joefarebrother committed Aug 24, 2023
1 parent f32198c commit a253d6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ActionMethods
// Other queries check that there are authorization checks in place for admin methods.
private predicate needsChecks(ActionMethod m) { m.isEdit() and not m.isAdmin() }

private Expr getParentExpr(Expr ex) { result = ex.getParent() }
private Expr getParentExpr(Expr ex) { result.getAChildExpr() = ex }

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

/**
* Holds if `m` is a method that modifies a particular resource based on
* and ID provided by user input, but does not check anything based on the current user
* an ID provided by user input, but does not check anything based on the current user
* to determine if they should modify this resource.
*/
predicate hasInsecureDirectObjectReference(ActionMethod m) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<overview>
<p>When an action method accepts an ID parameter used to control which resource (e.g. a comment, a user profile, etc)
is being accessed/modified, checks should me made to ensure that the current user is authorized to access that resource.
Otherwise, an attacker could access an arbitrary resource by modifying the ID parameter.</p>
Otherwise, an attacker could access an arbitrary resource by guessing the ID parameter.</p>

</overview>
<recommendation>
Expand Down

0 comments on commit a253d6f

Please sign in to comment.