Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Improve security of Token storage #61

Closed
3 tasks
jamespohalloran opened this issue Sep 4, 2020 · 1 comment
Closed
3 tasks

Improve security of Token storage #61

jamespohalloran opened this issue Sep 4, 2020 · 1 comment

Comments

@jamespohalloran
Copy link
Contributor

jamespohalloran commented Sep 4, 2020

Currently, in the Dashboard we are storing the token in local storage. This helps prevent CSRF attacks, but with XSS, one could scrape localstorage on the client-side and steal our token.

I'm up for suggestions, but I'm wondering if we can proxy the code-exchange through a hosted function so we can create the token serverside (as http-only).
To mitigate CSRF, the token could be created as Same-site strict, or use something similar to our CSRF workaround in the Next-Github solution.

TODO:

  • Implement some backend helpers for the CSRF Token approach
  • Implement an in-memory approach, and make it the default (As recommended by both Auth0 and Cognito's clients)
  • Make the token storage configurable by a key within the ForestryClient props
@jamespohalloran
Copy link
Contributor Author

Closing this issue, as we have #85
With this change, you can store the token in memory, it's just a matter of documentation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant