parse-server: Unauthenticated deletion of class schemas removes class-level permissions on MongoDB
What fixes it
- 9.10.4-alpha.4parse-server, npmGitHub
npm install parse-server@9.10.4-alpha.4 - 8.6.101parse-server, npmGitHub
npm install parse-server@8.6.101
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Impact
On deployments that use MongoDB, a client without the master key can delete the stored schema of any class through the REST API. This removes the class's field definitions, class-level permissions and protected fields, including those set with the protectedFields server option. Data protected only by these can then become readable and modifiable by any client, and a class can become inaccessible to clients until it is re-created. Object ACLs continue to apply. Deployments that use PostgreSQL are not affected.
Patches
Client requests to class names that are not valid class names, including the internal schema collection, are now rejected unless they use the master key or maintenance key.
Workarounds
Register a Cloud Code beforeDelete trigger for the class name _SCHEMA that rejects requests without the master key. Upgrading does not restore schemas that were already deleted; review the class-level permissions, protected fields and field definitions of all classes and restore them where needed.
References
- GitHub security advisory: https://github.com/parse-community/parse-server/security/advisories/GHSA-qmg9-m772-5rm7
- Fix Parse Server 9: https://github.com/parse-community/parse-server/pull/10767
- Fix Parse Server 8: https://github.com/parse-community/parse-server/pull/10768
Text from GitHub Advisory Database
Affected versions 2
- parse-server, npm>= 9.0.0, < 9.10.4-alpha.4GitHub
- parse-server, npm< 8.6.101GitHub