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
We updated Parse Server to version 4.5.0, and included in the latest security changes, now we can not use certain restricted fields like length
or className
as this merged PR explains: #7053
We have a class in production since Parse Server 3.0.0 that has been using the newly restricted field length
so now we can not create or edit objects of that class as Parse returns an error: {Invalid field name: length., code=105}
As a workaround, we've tried to unset the length key in a beforeSave hook of that class. That works great for any object which is newly created, but not for object updates (tested with REST API POST and PUT). When updating an object, the beforeSave hook is not called, and Parse Server returns an error before we can unset the key.
This issue attempts to open a discussion about how to work this concept out. As suggested by @mtrezza we could allow the "reserved" field names by encoding fields differently in the Parse Object. #7053 (comment)
Steps to reproduce
Create a class in Parse Server 4.4.1 (or anything lower than 4.5.0) with the field length
.
Create some objects for that class.
Update Parse Server to (4.5.0).
Attempt editing those objects or creating new ones by REST API POST and PUT, or from Parse dashboard.
Actual Outcome
The object can not be created or edited: {Invalid field name: length., code=105}
Expected Outcome
The object is successfully created or edited.
Environment
Server
- Parse Server version:
4.5.0
- Operating system:
Linux
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Heroku
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
4.4.3
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
mLab
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
iOS
- SDK version:
1.19.0
Logs
From iOS: Error Domain=Parse Code=105 "Invalid field name: length." UserInfo={error=Invalid field name: length., NSLocalizedDescription=Invalid field name: length., code=105}