-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
_User ACL not working correctly #3588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We don't allow users to modify other user's ACL for security reasons. |
Then what's the point of ACL's? Without editing users, you're limiting Parse's functionality as it can't be used for anything user management related, you can't design a system that has moderators or administrators without splitting all user content into another table. Which for already established applications is upsetting. We've unfortunately had to use the |
I believe this restriction was set in parse-server as it was there on parse.com |
Are you sure? - I continued to use the parse hosted solution up until January (as I couldn't find the time to transfer it sooner). And my Administrator ACL was able to update users. |
it doesn't mean I'm sure. |
@awsGeorge you could use a cloud function Also are you now using the master key in a publicly facing webpage? That would be a huge security issue. |
@johanarnor Yes - it was a quick work around, naturally the page in question requires elevated privileges, but I would prefer not to use the master key, as it seems like a hack to reinstate it's original functionality. |
Ok, but how is a user authenticated to reach that page? Is the page a part of a single page application that anyone can access from public internet? If so, your master key is publicly available. |
No - It's using the PHP SDK. |
The same issue. I have to perform access control checkings myself using Parse Cloud functions. |
+1 I would expect the User class to adhere to the same ACLs as everything else. I can understand setting the default ACLs for the User class differently for security reasons, but if I explicitly set the ACL of a user to a role ("Admin" read/write), I would expect that a logged in Admin can read and write that User. The work arounds are either to POST to an endpoint and useMasterKey, or create a separate "User Meta" class and have to deal with the complexities of the extra join query. |
+1 The User class should adhere to the same ACLs as any other class. Otherwise, user management at an elevated role is impossible without using a hack/workaround. |
I'll work on the enhancement while maintaining a good amount of security:
|
Any news on this ? |
Not yet, haven't had a chance to make a dent. But in the meantime, anyone can take it on, what's expected is detailed enough |
Looks easy...for you :) |
Anyway, I'll use a Cloud function. |
Right - taking a stab. Can you point me to the ACL checking code? I removed the basic checks thinking it would fall back to normal ACL checking, but it didn't, contrary to this comment: |
It looks like the the ACL is translated to a native database ACL, so presumably there is no checking, and we let the database handle the permissions? I need a simple way to compare the current user ACL with the object ACL for the |
@flovilmart Is this already implemented? Or do i need to use Cloud functions? |
@opit7 on the latest parse-server users can be locked out when using a masterKey but the rest of the implementation hasn't been implemented yet. |
@flovilmart may you by chance still have the rest of the implementation on the road map for the nearer future? |
I haven't had the chance to implement it, and at the time being, there is debate as for the security implication of changing this model. While I hear the ones from the camp saying Users should follow ACL's, I'm not sure changing it now is a great idea. Anyhow, this is still pending a good solution, that takes into account the maintainer concerns and the need of the community. In the meantime, there are plenty of possible alternatives, including using a cloud function to lock out users with the masterKey. |
@flovilmart The main use was for a moderation helper app. I did implement alternatives now, however it added more complexity which i am not sure that was needed, but i can be totally wrong here as i do not have much information about the security implications it may have. |
Related issue #4789 |
* Fixes an issue that would let the beforeDelete be called when user has no access to the object * Ensure we properly lock user - Improves find method so we can attempt to read for a write poking the right ACL instead of using masterKey - This ensure we do not run beforeDelete/beforeFind/beforeSave in the wrong scenarios * nits * Caps insufficient
@awgeorge finally it's in! Users will follow ACL's while being extra secure! |
* Fixes an issue that would let the beforeDelete be called when user has no access to the object * Ensure we properly lock user - Improves find method so we can attempt to read for a write poking the right ACL instead of using masterKey - This ensure we do not run beforeDelete/beforeFind/beforeSave in the wrong scenarios * nits * Caps insufficient
* Fixes an issue that would let the beforeDelete be called when user has no access to the object * Ensure we properly lock user - Improves find method so we can attempt to read for a write poking the right ACL instead of using masterKey - This ensure we do not run beforeDelete/beforeFind/beforeSave in the wrong scenarios * nits * Caps insufficient
…arse-community#4860) * Fixes an issue that would let the beforeDelete be called when user has no access to the object * Ensure we properly lock user - Improves find method so we can attempt to read for a write poking the right ACL instead of using masterKey - This ensure we do not run beforeDelete/beforeFind/beforeSave in the wrong scenarios * nits * Caps insufficient
Issue Description
Updates to
_User
record do not adhere to the ACL correctly. If a moderator is editing another_User
record (i.e not their own data). With the correct ACL's in place, the server always denies permission due to this lineAs you can see the function will only return true if we're using the master key or the object is the currently logged in user.
The comment implies that the ACL can still override, but this is not the case.
Steps to reproduce
Correctly assign ACLs to the user record so that the currently authenticated user should be able to edit the record.
Edit the
_User
recordExpected Results
A successful outcome.
Actual Outcome
Environment Setup
Server
Database
Logs/Trace
Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.
The text was updated successfully, but these errors were encountered: