Live data from Hacker News

HTML5 localStorage allows sites to fill up users' hard disks

feross.org

101–110 of 191 posts

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

#101
post #41

Earlier quoted context omitted.

What's your point? That people can be annoying?

No, that this is a double standard people have. They gripe about any non-YouTube site playing audio, but say nothing when they click a bit.ly link that redirects to a YouTube video page.

People absolutely do complain when they click a bit.ly link that redirects to a YouTube video page.

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

#102
post #93
post #5

Earlier quoted context omitted.

You can use Firefox. Firefox actually implements a reasonable storage limit policy for this. 10MB for an entire domain (all subdomains included)

How does Firefox determine if something is a domain or a subdomain? Obviously the term subdomain is relative, so domain.com is already a subdomain of .com. But what about countries like the UK or South Africa where domains are commonly subdomains of .co.uk and .co.za? Is there some generic way to know when a domain should be treated as a subdomain or do they basically hardcode the exceptions? Example: does domain1.co…

There are already hardcoded lists for this that's used to limit the scope of cookies (so nobody can try to read all the cookies on *.uk).

I imagine these lists will become a real headache when the recent TLD auction is over. Is there any work being done on a more dynamic system (DNS TXT fields?)

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

#103
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…

Anything that crashes the browser in a predictable way is pretty worrying.

The approach to runaway scripts would work quite well here..

This Page is filling up your hard drive, do you want to a) crash, b) clear all data from this domain

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

#104
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.…

What about this: writes to a.mydomain.com from a page with www.mydomain.com in the address bar count towards the quota for both a.mydomain.com and www.mydomain.com. You'd have to store the other domains your page has written to in its own local storage area, but it doesn't seem to me like the book keeping would be that complicated. You could use a coarse rule of all data in a.mydomain.com counts, and use a larger quo…

You could simply fill up your subdomain's local storage and then do a javascript redirect to another subdomain.

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

#105
post #97

Earlier quoted context omitted.

Limit how much can be placed in localstorage regardless of site based on time. (Or perhaps prompt whenever that limit is reached, in case there is a legit reason for it.) This isn't perfect in that your localstorage could still be filled up slowly if you leave a page open in the background, but I think this solution is robust to many different techniques.

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.

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

#106
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…

I think localStorage already asks the user.

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

#107
post #52
post #47

Earlier quoted context omitted.

Sorry, maybe this is obvious, but — how do you fill up a remote HD with just an IP and hostname with nmap and friends?

Well, I meant you can use these tools to gain access to the remote machine to do some real damage. Nmap and friends are usually for finding running services, list of open ports, knock on a few doors (run some queries?) etc... and if someone were to gain access to a machine this way, filling up their hard drive may not be on their list of priorities. Unless incrimination was the intention.

Really. I assumed you were talking about some nmap-based attack I hadn't heard of. That maybe fills the target's HD with log files or something. Wondered whether that would work cross-platform on any device, like this attack. Wondered whether it could be pulled off by an idiot with a grudge, like this attack. Or whether targeting someone by IP isn't in fact actually harder than being able to do it by getting someone to click on any link, anywhere.

But yes, indeed, if the machine's already vulnerable to something else, then that is possibly much worse.

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

#108

The message is OK, but personally I have an issue with websites playing sound without my consent.

OK, why does YouTube get a free pass on this? Nobody has ever given me a good reason.

FWIW I wish youtube didn't autoplay.

Not that I care about unexpected noises in a situation like this, but I hope we all agree that unexpected and unwanted noises are genuinely annoying to many people.

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

#109
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.…

> The question I'm asking myself now is how to fix this.

Doesn't the website answer that? Just follow the spec! Firefox isn't vulnerable…

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

#110
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…

Arguably, that's the spirit of the FileSystem API.

http://www.w3.org/TR/file-system-api/

> An application can request temporary or persistent storage space. Temporary storage may be easier to get, at the UA's discretion [looser quota restrictions, available without prompting the user], but the data stored there may be deleted at the UA's convenience, e.g. to deal with a shortage of disk space.

> Conversely, once persistent storage has been granted, data stored there by the application should not be deleted by the UA without user intervention. The application may of course delete it at will. The UA should require permission from the user before granting persistent storage space to the application.

Post reply on HN