parse-community / parse-community/parse-server
Embedded document modification requires addField permission
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
Using PUT to modify a nested document fails unless the caller has addField permissions, even if the request doesn't add a new field.
Steps to reproduce
- Create a new class, nested_test.
- Remove public addField permission from the class.
- Use
PUSHto create this object:{ "a": {"b":1}} - Use
PUTto change the 1 to a 2 :{"a.b": 4} - Observer that the operation fails due to a lack of addField permission.
- Grant addField to the public for the class.
- Observe that the request now successfully modifies the nested key.
Actual Outcome
The first PUT request should succeed, even without the addField permission, because it does not add a new field.
Expected Outcome
It fails due to a lack of addField permission.
Failing Test Case / Pull Request
- 🤩 I submitted a PR with a fix and a test case.
- 🧐 I submitted a PR with a failing test case.
Environment
Server
- Parse Server version:
94b7b32, a commit from 19/04/2021 - Operating system:
Ubuntu 20.04 - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
4.4.5 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
any - SDK version:
any
Logs
Contributor guide
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 reproducing the case with the nested_test class: remove public addField permission, create {"a":{"b":1}}, and send the nested PUT update. Trace the permission check involved in modifying an existing nested key, then verify that the update succeeds without addField permission and add or run a regression test for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- api, authorization, backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100