-
Notifications
You must be signed in to change notification settings - Fork 31
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
SECURITY: Token should not be stored in the localstorage to limit XSS vulnerability #24
Comments
I advise that the current version is deprecated in npm to show this issue. Until a fix is published it will continue to warn developers during install. https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions |
Is this library still supported? This needs fixing |
Feel free to create pull request mate |
Relevant: https://pragmaticwebsecurity.com/articles/oauthoidc/localstorage-xss.html
|
Totally agree. Patches welcome! Should bump major version or add backwards-compatible support for reading localStorage though. |
This idea is debatable and will require backend code change. Cookies are prone to a CSRF attack and XSS even without localStorage, if done, will deal a lot of damage. |
XSS would apply to localStorage as well, right? The difference is cookies can be set HTTPOnly? |
@revmischa XSS, if it already happened, applies to localStorage and cookies that don't have HTTPOnly flag. But on the other hand CSRF applies to any cookie unless it has flag With cookies without sameSite we need to go extra mile to create protection against CSRF with one technique or another. localStorage is always protected against CSRF by design. |
Do not look for the problem in the localStorage, instead safeguard you app against XSS attacks. Not an issue of this lib, neither localStorage |
The token should be added in a httponly cookie and only the refresh token should be stored.
See https://dev.to/cotter/localstorage-vs-cookies-all-you-need-to-know-about-storing-jwt-tokens-securely-in-the-front-end-15id
The text was updated successfully, but these errors were encountered: