Re:Progressive web apps are coming to iOS 11.3: Cupertino, w...
by walterbell on Sunday January 28, 2018 @04:14PM
(#16253541)
Some discussion here: https://news.ycombinator.com/item?id=16250519
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w...
by Klathmon on Sunday January 28, 2018 @04:26PM
(#16253623)
Ah, so in that case yes, it's safe from the extreme majority of XSS, because I use Content-Security-Policy headers.
Any cookies would also be subject to XSS, unless they have the HTTP-Only flag set, in which case the whole point is not worth discussing because JavaScript cannot access it or even know it exists, so it would obviously be useless to any javascript.
Localstorage (and friends like WebSQL and IndexedDB) and Cookies serve different purposes, and having data in IndexedDB is no less "secure" than having it displayed on the page. In both cases an XSS attack means game over.
IndexedDB is subject to the same origin policy, so only javascript executed on my domain can access the data for my domain.
Combined with a good Content-security-policy means I'm in control of exactly what code gets to access those resources.