It's still possible create relation Objects of User when logged User was deleted.
When i'm using Explorer to test ACLs i see this case: It's still possible create relation Objects of User when logged User was deleted. Case:
- User has many Books (userId)
- Books belong to User (userId)
Step like below:
- Create User
- Login User
- Delete logged User (in case still logged - Token is set)
- Create Book (in case still logged - Token is set) - It's still can do this why ?
I don't know why when deleting User, you don't delete AccessToken so when i create Book it can use userId of Token to create Book but User of userId is not available. ?
Good catch. There are a few things that can be enforced:
- The token middleware should check if the token and it's user id are still valid.
- Ideally, when a user is deleted or password is changed, access tokens created for the user should be invalidated. We can store a hash of the user credential as a property of the token so that it can be used to verify if the user credential has been changed.
Sent from my iPhone 5
On Sep 23, 2014, at 7:58 PM, SangNT [email protected] wrote:
When i'm using Explorer to test ACLs i see this case: It's still possible create relation Objects of User when logged User was deleted. Case:
User has many Books (userId) Books belong to User (userId) Step like below:
Create User Login User Delete logged User (in case still logged - Token is set) Create Book (in case still logged - Token is set) - It's still can do this why ? I don't know why when deleting User, you don't delete AccessToken so when i create Book it can use userId of Token to create Book but User of userId is not available. ?
— Reply to this email directly or view it on GitHub.
when password is changed, access tokens created for the user should be invalidated.
IMO this should be configurable. Invalidating existing access tokens on password change can be very annoying, as you have to re-login from all devices. E.g. Facebook used to have a checkbox "log me out from all devices" in the change-password-form, so that the user could decide.
+1 to make it configurable.
@loay please back-port the fix to 2.x, the issue is not "done" until then.
- [x] Fix security issue: https://github.com/strongloop/loopback/pull/2492
- [x] backport: https://github.com/strongloop/loopback/pull/2540
- [x] address issue concerning test case. https://github.com/strongloop/loopback/pull/2549
- [x] backport after fixing test cases. https://github.com/strongloop/loopback/pull/2553