You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Saving" a new PFUser behaves weirdly (iOS and JS)
"signUp" has a minor security flaw or at least inconsistency (tested on iOS, with CLP locked)
Session tokens created even if user isn't created (tested on iOS and JS, with CLP locked and no masterKey used)
Re: "saving" new PFUsers
When saving a new PFUser on iOS, the SDK(?) throws this error:
Caught "NSInternalInconsistencyException" with reason "User cannot be saved unless they are already signed up. Call signUp first."
When saving a new PFUser via Cloud Code, it does not throw that error but simply mimics a "signUp", which creates a session token for the server... in Cloud Code! (actually, read #3 as this may be a bug with the pfuser handling)
For sake of flexibility and consistency (with PFObjects), I think there should be an option to "save" a PFUser without having a session token created, or restricting (iOS) apps to always use PFUser.signUp. There are many use-cases for such a feature, and I feel that it is a meaningless restriction.
Personal use-case: I have some special logic to replace the standard "signUp" flow, which has me creating a PFUser via Cloud Code + MasterKey. But with how the "save" function is behaving, it's creating a session token for the server!
Re: "signUp" security flaw with table fully locked down
With the CLP's fully locked down (no public read/write/field addition), attempts to signUp with an existing username throws this error (what you'd expect if the User table had public read permission):
Optional(Error Domain=Parse Code=202 "Account already exists for this username" UserInfo={code=202, temporary=0, error=Account already exists for this username, NSLocalizedDescription=Account already exists for this username})
When trying to signUp with a new username (same CLP settings -> locked), then the normal response is given:
[Error]: Permission denied for this action. (Code: 101, Version: 1.13.0)
Optional(Error Domain=Parse Code=101 "Permission denied for this action." UserInfo={code=101, temporary=0, error=Permission denied for this action., NSLocalizedDescription=Permission denied for this action.})
For security reasons, "permission denied" should be sent if the CLP doesn't allow for it, instead of telling someone (who is probably not working in your scope of the app) valuable information.
Re: Session Tokens out of control
Steps to reproduce (in iOS SDK or Cloud Code):
Lockdown User table (and session table if you want.. doesn't change outcome) in Server v2.2.6 Dashboard v1.0.8
In iOS or Cloud Code, try to sign a new PFUser up (in Cloud Code, you can use .signUp or .save)
Get error response
Check dashboard
See a new session token
The text was updated successfully, but these errors were encountered:
DoneStuffGetting
changed the title
Edgy edge cases re: PFUser.'save' and signUp in iOS/JS/CloudCode
Edgy edge cases re: dysfunctional CLPs, PFUser.'save' and signUp in iOS/JS/CloudCode
Apr 14, 2016
DoneStuffGetting
changed the title
Edgy edge cases re: dysfunctional CLPs, PFUser.'save' and signUp in iOS/JS/CloudCode
Edgy edge cases/bugs re: dysfunctional CLPs and Session Token generation (tested in iOS/JS/CloudCode)
Apr 14, 2016
Parse v2.2.6
Two things I wanted to discuss:
Re: "saving" new PFUsers
When saving a new PFUser on iOS, the SDK(?) throws this error:
When saving a new PFUser via Cloud Code, it does not throw that error but simply mimics a "signUp", which creates a session token for the server... in Cloud Code! (actually, read #3 as this may be a bug with the pfuser handling)
For sake of flexibility and consistency (with PFObjects), I think there should be an option to "save" a PFUser without having a session token created, or restricting (iOS) apps to always use PFUser.signUp. There are many use-cases for such a feature, and I feel that it is a meaningless restriction.
Personal use-case: I have some special logic to replace the standard "signUp" flow, which has me creating a PFUser via Cloud Code + MasterKey. But with how the "save" function is behaving, it's creating a session token for the server!
Re: "signUp" security flaw with table fully locked down
With the CLP's fully locked down (no public read/write/field addition), attempts to signUp with an existing username throws this error (what you'd expect if the User table had public read permission):
When trying to signUp with a new username (same CLP settings -> locked), then the normal response is given:
For security reasons, "permission denied" should be sent if the CLP doesn't allow for it, instead of telling someone (who is probably not working in your scope of the app) valuable information.
Re: Session Tokens out of control
Steps to reproduce (in iOS SDK or Cloud Code):
The text was updated successfully, but these errors were encountered: