jamesplease / jamesplease/api-pls
More robust "additional_condition"
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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