parse-community / parse-community/parse-server

ParseUser.fetchInBackground() fails when _User CLP without public get permission

Open
#6,940 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

I am using CLP to restrict access to the _User collection, essentially removing all permissions for the public except for create permission. This in my understanding means that anybody can sign up to create an account (POST to /users) but do nothing else unless they are logged in. They can not browse users, or get info about random user by trying to guess objectId and performing random GET /users/abcd for randomly generated abcd.

When the user is logged in (they send a valid X-Parse-Session-Token in the headers) they can GET /users/me to fetch info about their own user account successfully.

The user however can not currently perform GET /users/abc where abc is objectId of a user for which the user successfully obtained a session token via signup or login.

This can easily be demonstrated via iOS or Android SDK where a call to

ParseUser.getCurrentUser().fetchInBackground()

fails with:

error: Permission denied for action get on class _User.

I am sure this may be addressed by setting up proper ACL on the _User collection entries, but I still think the default behavior should be that ParseUser.getCurrentUser().fetchInBackground() should succeed for user for which I have a session token.

Contributor guide

Open the contributing guide

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 reproducing the reported behavior with a _User CLP that allows only public create, then compare GET /users/me and ParseUser.getCurrentUser().fetchInBackground() with a valid session token. Done means an authenticated user can fetch their own account without exposing other users, with coverage for the described permission boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
api, authorization, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.