-
Notifications
You must be signed in to change notification settings - Fork 117
authenticate() can leak sensetive user data via token service #162
Comments
You can always change the data returned by the service with an after hook. However I also find it a bit obscure that it ignores |
Adding after hook to token service is not problem. But first of all you must know about such behaviour. And second I prefere to secure the concrete data in one place not around all the project. |
If the hook on the service is a The token service should remove the user password field before returning already though so there might be a bug there. |
@farwayer can you please provide example code where you are seeing this behaviour? Then we can determine if there is a security issue or not. Thanks 😄. |
Use case: I have |
I think the right fix would be to retrieve the user object twice, once without params (to compare the password) and once with parameters (so that all hooks run and you send it back with the token). |
@farwayer Just add an I'm going to close this as that should do the trick. If not we can revisit. This may actually just be a documentation thing and something we can create an issue for in the |
Token service returns all user data except password field. It ignores all
after
hooks fromuser
service so it can leak some sensetive data. It should be documented at least.The text was updated successfully, but these errors were encountered: