jamesplease / jamesplease/api-pls

More robust "additional_condition"

Open
#237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Right now, you can bypass the auth enforced by `additional_condition()` by accessing it through a relationship. For instance:

1. create a resource. it is owned by you. link it to any other resource ID. the update will work, since I don't prevent creation of relationships by ownership.
2. if a resource has a relationship to another resource owned by someone else, then it will be returned (this is similar to 1, but a subset of the problem)

I'll need to think about how to make the ownership here more solid.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing additional_condition() and the relationship access paths described in the issue. Reproduce the two ownership scenarios: creating a relationship to another resource and retrieving a related resource owned by someone else. Done means the authorization enforced by additional_condition() cannot be bypassed through relationships.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, authorization, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.