News for hackers. Stuff that matters.
Re:SPAs Are Dead? by warent on Wednesday April 07, 2021 @03:25PM (#26729790)
If your third party libraries are so poisoned that you're leaking localstorage, you've got bigger problems than just localstorage... This argument against using localstorage makes no sense
Re:SPAs Are Dead? by tmpz22 on Wednesday April 07, 2021 @03:41PM (#26730039)
Chrome extensions can also inject code via a content script and gather local storage data. You can't control what extensions people are running.
Re:SPAs Are Dead? by minhazm on Wednesday April 07, 2021 @03:54PM (#26730249)
That also applies to cookies. Users can run any browser or script to access your site and do whatever they want with the cookies.
Re:SPAs Are Dead? by gigaftp on Wednesday April 07, 2021 @04:13PM (#26730528)
In the context of a compliant web browser you can set a cookie as http only as to disallow access it via Js.
Re:SPAs Are Dead? by Jenk on Wednesday April 07, 2021 @04:20PM (#26730623)
Not for http-only cookies it doesn't.
Re:SPAs Are Dead? by fractionalhare on Wednesday April 07, 2021 @04:55PM (#26731125)
No they can’t, refer to the documentation on cookie flags and attributes like httpOnly: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
Re:SPAs Are Dead? by midrus on Thursday April 08, 2021 @03:01AM (#26735903)
Security is not black and white. It is a spectrum of possibilities and an arms race between security measures and new attack strategies. So lowering all your barriers because one of them could be already weak is not a good strategy.

If you're sending your password in plain text without HTTPs, then saying "ok, nevermind, we already have that problem so let's just not use any CSRF protection" you're just making things worse.

Authentication tokens that allow anyone reading them to impersonate you are bad, no discussion about it. Go and google for this if you don't believe me. Ask any security expert (which I'm not).

Cookies have the exact same problem. Except if you set the http-only flag in them, which is what I'm advocating for here.

You can still use localStorage, just not for security tokens.

Re:SPAs Are Dead? by anaphor on Thursday April 08, 2021 @01:24PM (#26741439)
You seem to be unaware of the existence of capability based security. https://en.wikipedia.org/wiki/Capability-based_security