Live data from Hacker News

HTML5 localStorage allows sites to fill up users' hard disks

feross.org

171–180 of 191 posts

Re: HTML5 localStorage allows sites to fill up users' hard disks

#171
post #44

Well this is frightening. You don't even need to create subdomains since basically anyone with wildcard subdomains enabled can do this without a sweat. All you need is a random number generator and rewrite x.domain.com to domain.com and the browser is none the wiser. Though I can't quite imagine why anyone would want to do this to some random stranger. Unless you knew the visitor or had some means of personally ident…

> Though I can't quite imagine why anyone would want to do this to some random stranger. You must be new to the internet? > Unless you knew the visitor or had some means of personally identifying him/her, there are more devastating ways of filling up a remote HD with just an IP and hostname (nmap and friends come to mind). There's a few things: This works by sending someone a link. So you can target people without kn…

You are correct about what Chrome would do, yes.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#172
post #169

Earlier quoted context omitted.

Too bad that outstanding solution will be vaporized from the face of this earth and replaced by Chrome's implementation!

Why is it assumed that Opera will be exactly the same as Chrome? Is it not possible for Opera to keep their own implementation of LocalStorage (and other things)? Am I wrong in assuming RenderEnginge != Browser?

Opera has stated publicly that they will be using all of Chromium (which would include LocalStorage, V8, etc), not just WebKit per se.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#173
post #169

Earlier quoted context omitted.

Why is it assumed that Opera will be exactly the same as Chrome? Is it not possible for Opera to keep their own implementation of LocalStorage (and other things)? Am I wrong in assuming RenderEnginge != Browser?

Opera has stated publicly that they will be using all of Chromium (which would include LocalStorage, V8, etc), not just WebKit per se.

Thanks! Must have missed that...

Re: HTML5 localStorage allows sites to fill up users' hard disks

#174
post #50

So. The question I'm asking myself now is how to fix this. Giving .domain.com a shared quota will allow one tumblr or github pages user to monopolize all storage, effectively removing local storage for this kind of scenario (also removing it for the host which is even more annoying). A maybe workable solution would be to only allow creation of new keys for the first-party origin. What I mean is that whatever.example.…

Any kind of DOM storage (cookies, localStorage, IndexedDB, etc.) is ephemeral. The browser needs to decide the maximum amount of disk space that it wants to consume, and then when it hits that limit, it needs to start throwing away (garbage collecting) some of the data based on some policy like LRU. If the web app really needs permanent storage then that permanence of storage needs to be granted explicitly by the use…

There are better options than LRU which gets too easily flushed.

Check out CLOCK-Pro and LIRS.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#175
post #77
post #75

Earlier quoted context omitted.

Limit the total local storage space at a browser level. E.g. 1GB. Just like you might limit the total size of temporary internet files/cache. Beyond that, just provide a good (simple) UI for deleting stuff. Which could suggest candidates for deletion based on heuristics like you suggest. E.g. iframes shouldn't need so much. Hopefully less visited sites would be suggested for deletion too.

> Limit the total local storage space at a browser level. E.g. 1GB I wouldn't mind Google Maps to fill some 100 GiB with map data so that I can have detailed maps while I am offline in some remote African town.

Then it should be a browser preference.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#177
post #50

So. The question I'm asking myself now is how to fix this. Giving .domain.com a shared quota will allow one tumblr or github pages user to monopolize all storage, effectively removing local storage for this kind of scenario (also removing it for the host which is even more annoying). A maybe workable solution would be to only allow creation of new keys for the first-party origin. What I mean is that whatever.example.…

Give a standard amount to top-level domains (like tumblr.com), but keep track of it per-subdomain (so you know how it's divided up, even though it all adds up to the same quota).

Then, whenever space is used up, ask the user if they're willing to authorize extra space for the specific subdomain being added to. If they say yes, then it's authorized for that single subdomain (but not other ones).

I don't think there's any "automatic" way to do this, without asking the user. And I think most users would prefer to be asked.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#178
This kind of thing is a good reason why a monoculture would be bad for the Web. It's entirely possible that, if WebKit had a monopoly, Web sites would rely on subdomains' space not being counted toward the parent domain's space, and it'd be impossible to fix this bug without breaking the Web. But because we don't have a monoculture and some browsers implemented subdomain limits, Web sites haven't been able to rely on WebKit's behavior. So WebKit will be able to fix the bug without breaking the Web—which is better for WebKit, and better for the Web.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#179
post #105
post #97

Earlier quoted context omitted.

Prompt is the best solution to this. There's a prompt with flash.

Prompt is a horrible solution from a UX perspective. Essentially you're asking the user a question you, as a developer, couldn't or didn't want to answer. But the user has no idea either. Heck, she doesn't even know that there are limits in place or what DOM local storage even is.

That's a bit like saying passwords and PINs are bad from a UX perspective. In a way, you're right, because any user flow gets simpler and smoother if you remove a password prompt, but it's pretty obvious why these things still need to exist.

Re: HTML5 localStorage allows sites to fill up users' hard disks

#180
post #44

Well this is frightening. You don't even need to create subdomains since basically anyone with wildcard subdomains enabled can do this without a sweat. All you need is a random number generator and rewrite x.domain.com to domain.com and the browser is none the wiser. Though I can't quite imagine why anyone would want to do this to some random stranger. Unless you knew the visitor or had some means of personally ident…

> Though I can't quite imagine why anyone would want to do this to some random stranger.

I'm going to guess you've never been Goatse'd.

Post reply on HN