News for hackers. Stuff that matters.
Re:Favicon bug by inglor on Monday June 15, 2015 @01:26PM (#9720715)
I'm the author of the GH repo and I just want to give full credit for figuring out Chrome does this to this guy: https://twitter.com/a_de_pasquale

All I did was think "if it works for 65mb why not more?" and write a quick proof of concept. Gets to 10gb on my 4gig laptop and then crashes. (MBA, OSX 10.10).

Re:Favicon bug by 0x0 on Monday June 15, 2015 @01:40PM (#9720811)
Wow, the twitter replies suggesting this was an accidental "tar cvf * backup.tar" sound right on the mark. Especially considering favicon.ico is probably the first file in a wp install, alphabetically.
Re:Favicon bug by s_kilk on Monday June 15, 2015 @02:32PM (#9721104)
This is my new favorite bug/mistake. It's just exquisite.
Re:Favicon bug by jfb on Monday June 15, 2015 @05:51PM (#9722351)
It really has it all, doesn't it?
Re:Favicon bug by aw3c2 on Monday June 15, 2015 @05:19PM (#9722205)
For everyone struggling with tar, please be aware that you can use long-form arguments. So instead of "tar cvf filename files" you use "tar --create --verbose --file file.tar files" or maybe another order like ""tar --create --file file.tar --verbose files"-

It is much more sensible and intuitive.

Re:Favicon bug by andrepd on Monday June 15, 2015 @05:50PM (#9722345)
Once you've used it more than once or twice, however, you will find that writing cfv is much more convenient than typing --create --verbose --file every time you want to tar something.
Re:Favicon bug by sp332 on Monday June 15, 2015 @10:05PM (#9723408)
But if it's code you're only writing once - like in a script - you might consider using the longer ones to avoid screw ups and improve maintainability.
Re:Favicon bug by tomphoolery on Monday June 15, 2015 @11:06PM (#9723568)
always use long form flags when writing scripts...have some consideration for the person who has to fix your code when you move on
Re:Favicon bug by icc97 on Tuesday June 16, 2015 @06:07AM (#9724783)
there's an xkcd for that...: https://xkcd.com/1168/
Re:Favicon bug by aw3c2 on Tuesday June 16, 2015 @12:51PM (#9727155)
I doubt that the creator or the promoters of the meme know about the long-form parameters. They make sense.
Re:Favicon bug by inglor on Monday June 15, 2015 @05:09PM (#9722140)
Wow, deeply impressed with Firefox who rolled a fix in 3 hours. Mad props.
Re:Favicon bug by tomjepp on Monday June 15, 2015 @07:40PM (#9722905)
Even better - this works with compressed favicons.

Take http://pastie.org/10242118 and create yourself a favicon file:

dd if=/dev/zero of=favicon.png bs=1M count=4096

gzip -9 favicon.png

you can now crash lots of browsers with minimal bandwidth usage :)

demo: http://dev.tomjepp.uk/

Re:Favicon bug by tomjepp on Monday June 15, 2015 @07:45PM (#9722928)
This makes a 4GB file when decompressed and is plenty large enough to crash a 32-bit browser. You may need a larger file to reliably crash 64-bit browsers.
Re:Favicon bug by jfoster on Tuesday June 16, 2015 @02:08AM (#9724062)
Haven't tried it, but does it crash the browser or the tab? Under Chrome's architecture, a page should potentially be able to crash the tab, but not the browser. (or that's my understanding of it, anyway)
Re:Favicon bug by yincrash on Monday June 15, 2015 @01:37PM (#9720792)
What prevents someone from doing this with a 1 px junk image that is many GB large?

edit: to clarify, i'm talking about in the page itself rather than the favicon.

Re:Favicon bug by smhenderson on Monday June 15, 2015 @02:04PM (#9720938)
Just a couple of off the cuff thoughts on that. Nothing out of the box prevents what you describe as far as I know but one of the points made in the article is that favicon is downloaded without any update to or indication from the status bar. An image on the page will at least throw up a "waiting for evil.com" in the status bar giving a user some indication that something being downloaded is causing a major slow down.

Typically an ad-blocker or script blocker can be used to prevent the image from downloading. But I don't know of a blocker add-on that worries about favicon.

Overall while annoying and a bit strange that this wasn't anticipated and fixed long ago I'd say this is probably a non-issue. As another poster said I don't see a payoff here so I doubt it will be actively exploited in some "internet screeching to a halt" kind of way.

Re:Favicon bug by stock_toaster on Monday June 15, 2015 @02:19PM (#9721021)

  > Overall while annoying and a bit strange that this wasn't anticipated and fixed long ago I'd say this is probably a non-issue. As another poster said I don't see a payoff here so I doubt it will be actively exploited in some "internet screeching to a halt" kind of way.
favicons can also be inserted dynamically. http://stackoverflow.com/questions/260857/changing-website-f...

If some site has a js injection bug, or there is someone doing MiTM like the Great Firewall, I suppose they could inject a favicon link that referenced some location on another site, with the intent towards DoS.

Re:Favicon bug by smhenderson on Monday June 15, 2015 @02:54PM (#9721257)
Well I don't disagree but on the other hand the article is focused on what it does to a client so I wasn't thinking it through the way you are.

It also occurs to me that given the ability to insert yourself between the client and the server has to open up a number of possible attack vectors that are more worth while than crashing the client. I get (I think) the point about if censorship is the goal this is a way to make clients stay away from a particular server but if you're in a position to MITM them why not just return 404's and be done with it?

Not trying to argue, :-) Just want to make sure I'm understanding your point correctly...

Re:Favicon bug by stock_toaster on Monday June 15, 2015 @03:05PM (#9721311)
I assume you can (untested) reference https endpoints with a favicon?

If you can inject html though, a hidden image would probably would just as well. Although the behavior of chrome apparently still requesting the favicon file after the tab has closed, and possibly storing it in the history or bookmark file, may make this more or less appealing. Unsure.

http://www.netresec.com/?page=Blog&month=2015-03&post=China%...

Re:Favicon bug by InclinedPlane on Monday June 15, 2015 @02:51PM (#9721243)
Different behavior. It'll cause the tab to load forever, but it won't cause the whole browser to crash or become unresponsive.
Re:Favicon bug by gprasanth on Monday June 15, 2015 @02:09PM (#9720969)
my guess is if no favicon is specified browsers request for the default favicon path after page load (possibly) in a non render thread. that's definitely an issue, right?

also, interesting discussion from wayback:

https://bugzilla.mozilla.org/show_bug.cgi?id=260500

Re:Favicon bug by protomyth on Monday June 15, 2015 @01:51PM (#9720871)
So a screwed up favicon can eat a wireless user's whole bandwidth for the month with them knowing it. Great...
Re:Favicon bug by olalonde on Monday June 15, 2015 @02:02PM (#9720928)
Not to minimise this issue but there are other ways for websites to silently waste user bandwidth. I think the real issue here is that it crashes Chrome and can render the computer unresponsive.
Re:Favicon bug by __z on Monday June 15, 2015 @02:31PM (#9721098)
So can a screwed up iOS app

http://www.troyhunt.com/2014/10/find-crazy-stuff-in-mobile-a...

"Here’s a pop quiz for you: how much data do you reckon this iPad app downloads when it first runs? I don’t mean how big it is to download from the App Store (it’s 25MB), I mean after you download it then simply tap the icon to fire it up, how much data does it pull down if you don’t touch it again? ... Try 1.8 gigabytes. You heard me, that’s not a typo. You open up this 25MB app and it’ll pull down dozens of files of dozens of meg each when you run it. Won’t someone please think of the bandwidth!!!"

Re:Favicon bug by ceejayoz on Monday June 15, 2015 @02:35PM (#9721117)
It'd be nice if downloading over X MB in a day was an extended permission just like access to contacts/photos/etc. is.
Re:Favicon bug by icefox on Monday June 15, 2015 @02:10PM (#9720975)
Only if you mobile browser actually download them, ios for example from what it looks like doesn't.
Re:Favicon bug by protomyth on Monday June 15, 2015 @02:45PM (#9721191)
Some folks use cell (direct or tethered) on our laptops.
Re:Favicon bug by inglor on Monday June 15, 2015 @03:15PM (#9721368)
Check out the PRs on the repo - there is a PR demonstrating this exploit in iOS.
Re:Favicon bug by cma on Monday June 15, 2015 @02:04PM (#9720939)
So can an ajax loop.
Re:Favicon bug by l1ambda on Monday June 15, 2015 @04:39PM (#9721924)
Or a big HTML file.
Re:Favicon bug by inglor on Monday June 15, 2015 @02:07PM (#9720952)
An ajax loop requires you to have JavaScript enabled and will show you a loader indicator.
Re:Favicon bug by aw3c2 on Monday June 15, 2015 @05:20PM (#9722222)
> loader indicator

There is nothing with Ajax that does that automatically or even by default.

Re:Favicon bug by diggan on Monday June 15, 2015 @02:32PM (#9721106)
How about just an huge image? The programmer implementing the ajax call doesn't necessary have to implement a loader indicator either...
Re:Favicon bug by inglor on Monday June 15, 2015 @03:03PM (#9721302)
The browser will give you a visual indicator (a loading sign) at the browser level for images or AJAX and JavaScript can be disabled.

With the favicon issue these things don't happen.

Re:Favicon bug by realityking on Monday June 15, 2015 @04:08PM (#9721719)
I'm pretty sure I've never seen a loading indicator for AJAX either in Safari or Chrome.
Re:Favicon bug by iDemonix on Monday June 15, 2015 @04:09PM (#9721724)
True but the amount of webpages I visit where the spinning icon never stops spinning, I don't really pay it a 2nd thought. An enormous image set to hidden would have a similar effect.

Mind you I'm sat at home with a 300Mbps fibre connection, so I don't give as much thought to bandwidth as a roaming 4G/3G user might.

Re:Favicon bug by plaguuuuuu on Monday June 15, 2015 @11:26PM (#9723638)
True, regarding JS.

Web workers will not show a loader indicator however. You could probably do a nice DDoS attack like this even. But it requires users to be on your site anyway. Might as well just stick 0day du jour on it.

Re:Favicon bug by tiglionabbit on Monday June 15, 2015 @04:03PM (#9721685)
This reminds me of a bug I found in an internal tool. We only had about 200 users, but somehow Apache would run out of workers because they were all busy serving some kind of request. Turns out our Apache configuration was wrong specifically in the case of serving the favicon. If you requested the favicon, it would get in a redirect loop, increasing the length of the url a little more each time until it hit the maximum url length and gave up. A new job like this would get kicked off every time any user visited a page, and it'd take several minutes before it finally gave up. So every user was unwittingly opening tons of long-running requests, with no indication that they were doing anything.
Re:Favicon bug by shawkinaw on Monday June 15, 2015 @07:57PM (#9722986)
Yeah, I hit something sort of similar but on the client side: While clicking around a single-page webapp, Chrome would manage to use up all its outbound connections (10 or so) trying to download non-existent favicons, leaving none for real use. And those favicon requests somehow never timed out. Chrome's favicon handling is pretty bad.
Re:Favicon bug by drivingmenuts on Monday June 15, 2015 @04:09PM (#9721732)
I pray once or twice a month that someone somewhere will just end the favicon.

Or at least make it's absence a non-logworthy event.

Or replace it with something sane, like a .png.

Re:Favicon bug by porges on Monday June 15, 2015 @04:43PM (#9721950)
All major browsers support PNG favicons
Re:Favicon bug by Dylan16807 on Monday June 15, 2015 @05:02PM (#9722077)
Not only is there support in practice, but PNG files have been technically-valid .ico files for a decade.

Edit: Actually on further investigation they might be omitting a header, but they're still 99% valid.

Re:Favicon bug by frozenport on Monday June 15, 2015 @04:56PM (#9722038)
Is storing data as bits insane? For a 32x32 image, jpg overhead becomes significant.
Re:Favicon bug by Dylan16807 on Monday June 15, 2015 @05:06PM (#9722121)
Why would you use JPG for something that should be pixel-art?

But it's not really that bad. Well under 200 bytes of overhead for 1000 pixels. PNG has under 50 bytes of overhead.

Re:Favicon bug by Someone1234 on Monday June 15, 2015 @01:39PM (#9720809)
Just doing some quick back of napkin maths, even assuming Apple's 128x128 app icons, and 48 bit colors (32 is more typical), we're still talking about a sub-100 kb max for a favicon.

So if Chrome set it even at 20 Mb that would still be orders of magnitude more than any favicon should be for at least the next five or so years (even assuming 256x256 became common for app icons).

Re:Favicon bug by vacri on Monday June 15, 2015 @05:53PM (#9722357)
"The most memory anyone needs is 640k"...
Re:Favicon bug by ahoge on Monday June 15, 2015 @06:19PM (#9722499)
Hard limits aren't much of an issue if updates are rolled out ever 6 weeks.
Re:Favicon bug by jfoster on Tuesday June 16, 2015 @02:25AM (#9724105)
That was said with a wide open scope. Bill was wrong because he hadn't imagined all the things people might do with PCs. In this discussion, the scope is very limited; favicons.
Re:Favicon bug by miahi on Monday June 15, 2015 @01:48PM (#9720852)
You can have animated favicons.
Re:Favicon bug by tomswartz07 on Monday June 15, 2015 @01:50PM (#9720868)
Even still, the animated favicons would be low framerate and fairly low resolution.

I don't think we're ready for 60 FPS .gifv favicons just yet. :)

Re:Favicon bug by daurnimator on Monday June 15, 2015 @07:20PM (#9722818)
Re:Favicon bug by logicallee on Monday June 15, 2015 @02:40PM (#9721152)
ten gigabytes is a helluva favicon animation... I wonder if it would be measured in hours, days, or weeks...
Re:Favicon bug by Johnny_Brahms on Tuesday June 16, 2015 @03:20AM (#9724233)
Let's go ahead and implement webm favicons. Months of pleasure from every single website visit!
Re:Favicon bug by fao_ on Monday June 15, 2015 @01:44PM (#9720834)
In reply to both this and the original discovery[1], I wonder if this is a valid (albeit morally dubious) method of backing up (or at least ensuring the survival of) information that is at risk from government/<insert 'bad person' here> censorship/removal/other.

NB: Not that I condone this.

[1]: https://twitter.com/a_de_pasquale/status/608997818913665024

Re:Favicon bug by TD-Linux on Monday June 15, 2015 @01:46PM (#9720846)
Did you file bugs for either of these two browsers?
Re:Favicon bug by groby_b on Monday June 15, 2015 @02:48PM (#9721220)
Is this a Mac only bug, or have you only repro-ed it on Mac?
Re:Favicon bug by fugyk on Monday June 15, 2015 @03:15PM (#9721369)
Why do browser people always forget about favicons? Most browser saved favicon on private browsing and then this.
Re:Favicon bug by frik on Monday June 15, 2015 @03:23PM (#9721415)
...and used favicons for the bookmarks.
Re:Favicon bug by Nadya on Monday June 15, 2015 @03:27PM (#9721437)
Mind telling me why that is an issue?

My bookmark bar is entirely favicons. I remove the name and this allows me to fit more in quick-access without having to delve into folders.

Re:Favicon bug by erichurkman on Monday June 15, 2015 @09:30PM (#9723304)
Same here. Sadly Safari does not use fav icons in the bookmark bar, so all of mine are emoji.

Unfortunately, you run out of sensible emoji very quickly, so my brokerage ends up 🎲, Github ends up 🐱, and Hacker News ends up ⌛️.

Re:Favicon bug by terminado on Monday June 15, 2015 @05:10PM (#9722154)
Because Microsoft.
Re:Favicon bug by gtk40 on Monday June 15, 2015 @01:28PM (#9720722)
How do other browsers behave?
Re:Favicon bug by inglor on Monday June 15, 2015 @01:31PM (#9720743)
Firefox doesn't behave too well either. Gets to 23169 in the counter http://i.imgur.com/3zkPKD7.png
Re:Favicon bug by moskie on Monday June 15, 2015 @01:35PM (#9720778)
So why single out Chrome in this repository and post? Feels like a hit piece on Chrome this way.
Re:Favicon bug by inglor on Monday June 15, 2015 @01:36PM (#9720791)
Well, I didn't really consider Firefox and I didn't want to publish anything unsubstantiated about it. No intent to single out or attack Chrome - I've changed the title to clarify that now that I have evidence this works in FF.
Re:Favicon bug by ecdavis on Monday June 15, 2015 @02:09PM (#9720967)
Investigating and reporting a bug should never be considered "singling out" of a piece of software. Personally, I'd be grateful if someone pointed out a critical issue like this in my code. It means I have the opportunity to fix it!
Re:Favicon bug by txru on Monday June 15, 2015 @01:39PM (#9720804)
Well, Chrome is a very commonly used browser, and I would guess that other browsers look to it for guidance on features.

Also, it seems to me that the post is only a proof of concept. "Hey, look at what happens here in this browser. I've extensively proven that it's possible. Maybe people should check it out under other circumstances."

Re:Favicon bug by underwater on Monday June 15, 2015 @04:03PM (#9721682)
You should try and use ServiceWorkers to generate the file -- then you can have the client DOS itself.
Re:Favicon bug by tomswartz07 on Monday June 15, 2015 @01:37PM (#9720798)
This seems like an active exploit, as pointed out in the OP's inspiration Twitter post.

`tar` up an entire WordPress install, save it as `favicon.ico` and then easily pull the files from the server.

This would be a good idea to get fixed very soon, I would assume.

EDIT: I stand corrected in terms of exploit-ability, but I still assert that crashing a browser and chewing tons of bandwidth are pretty big issues.

Re:Favicon bug by desbo on Monday June 15, 2015 @02:01PM (#9720921)
> `tar` up an entire WordPress install, save it as `favicon.ico` and then easily pull the files from the server.

assuming I have access to the server to create the tar and save it, what's the difference between downloading the archive as favicon.ico or any other name?

Re:Favicon bug by emidln on Monday June 15, 2015 @02:23PM (#9721041)
If you don't have control over the logging (for a number of reasons) you can disguise your xf in the access logs. I'd be willing to bet that a lot of logging config files for access logs even ignore favicon.ico.
Re:Favicon bug by simias on Monday June 15, 2015 @02:43PM (#9721171)
You could also hide it as any kind of regular static resource. I still don't understand how it's any worse than, say, hiding a massive image in a webpage. Bogus websites are going to be bogus no matter what, I can understand browser devs not wanting to guess arbitrary limitations for some resources when an hostile attacker will have plenty of other opportunities to achieve the same thing.

What would be the point of adding a limitation to the favicon size really? Protecting users from websites where the webmaster is silly enough to put a 1GB favicon by mistake? Doesn't seem common enough to warrant the extra code IMHO.

Re:Favicon bug by MichaelGG on Monday June 15, 2015 @03:21PM (#9721408)
>What would be the point of adding a limitation to the favicon size really?

Uh, yea, the browser shouldn't become unresponsive, break, or behave in such unexpected ways. Not having a limit is just sloppy. Understandable how it'd be overlooked, but sloppy none-the-less.

Re:Favicon bug by simias on Monday June 15, 2015 @06:17PM (#9722496)
That's reasonable, but won't you get the same result in a million other ways?

I agree that preventing the browser to become unresponsive when loading bogus/malicious pages is a worthy objective but I don't see why the favicon needs to be singled out as a "bug".

These kinds of deny of service attacks against browsers have been known since, like, forever and they're basically impossible to completely prevent given the surface of attack and the complexity of modern web pages.

Re:Favicon bug by Someone1234 on Monday June 15, 2015 @01:47PM (#9720849)
Whatever that website is, has an issue, since that backup.tar may contain their database credentials.

The favicon thing is just an annoying browser crashing bug. You could call that an "exploit" but up until fairly recently you were able to crash many browsers by generating too many message boxes (e.g. alert()) asynchronously.

So while, yes, it would be nice to fix it I don't really see it as being a high priority or one which will be actively exploited (since there is no "payoff" to either prankers or bad guys to this exploit).

Re:Favicon bug by inglor on Monday June 15, 2015 @01:59PM (#9720906)
Eating users' bandwidth has its uses as well as filling up a network with communication. This works with JavaScript disabled too but yeah I agree it's not a huge priority.
Re:Favicon bug by rlemon on Monday June 15, 2015 @02:42PM (#9721159)
I know for a fact that eating mobile bandwidth would be a huge priority for some (as far as getting it fixed). For example; I live in Canada and my mobile plan is only for 8gb. If I go over I have to pay a premium, and it is not a cheap premium. I don't think unlimited bandwidth on mobile is popular (at least here, I suspect other places cough India cough) as well.
Re:Favicon bug by Someone1234 on Monday June 15, 2015 @03:11PM (#9721354)
Even if you cap favicon size you don't solve the issue you're discussing at all.

A bad actor web-site can just move from favicon to an image, script file, or just return an indefinite series of HTML characters with no end.

The only way for the issue you want solved to be solved is for mobile browsers to add a "max page size" option, that will stop downloading content after it hits the cap.

In general this favicon bug is neither here nor there with the issue you're concerned about. Nobody needs this to waste your bandwidth.

The only reason this is noteworthy is that it is a little embarrassing for the browser vendors and it causes the browsers (Firefox and Chrome) to crash.

Re:Favicon bug by jakeogh on Tuesday June 16, 2015 @03:14PM (#9728139)
I like Surf's approach:

  if(g_str_has_suffix(uri, "/favicon.ico"))
      webkit_network_request_set_uri(req, "about:blank");
http://git.suckless.org/surf/tree/surf.c#n237
Re:Favicon bug by ubanholzer on Monday June 15, 2015 @02:21PM (#9721033)
it's also working on iOS 8.1.2. As soon as you tap on the share icon, the download starts: https://github.com/benjamingr/favicon-bug/pull/2
Re:Favicon bug by rjcz on Monday June 15, 2015 @03:55PM (#9721616)
I've noticed it several months ago by going through my server logs - hadn't included 'favicon.ico' in the HTML and yet, the browser - Chrom(e|ium) - tried downloading it every time.

Thanks for reminding me to report it ;^)

Re:Favicon bug by psychometry on Monday June 15, 2015 @04:06PM (#9721701)
Most browsers have been doing that since favicons have existed. Older versions of IE used to check for /favicon.ico no matter what, even if you specify a different URL with a <link> tag. You really have no choice but to make the file available at the URL even today.
Re:Favicon bug by iDemonix on Monday June 15, 2015 @04:07PM (#9721715)
That's not a bug, it's a feature. Pretty much every modern browser will look in the default spot for a favicon if you don't specify it.
Re:Favicon bug by hartator on Monday June 15, 2015 @01:58PM (#9720900)
Just tested on Safari 8.0.6, doesn't seem to download the favicon at all. Weird, even after closing the tab, Chrome still keep downloading the favicon.
Re:Favicon bug by ubanholzer on Tuesday June 16, 2015 @02:16AM (#9724085)
Safari Version 8.0.6 (10600.6.3) on OS X 10.10.3 is downloading it: https://imgur.com/B2LeRy4
Re:Favicon bug by empyrical on Monday June 15, 2015 @09:24PM (#9723277)
Should this have been done as a private disclosure to browser vendors first before going public, or is that more for security problems?
Re:Favicon bug by firlefans on Monday June 15, 2015 @01:56PM (#9720893)
Way to ruin the fun for the rest of us ;)
Re:Favicon bug by voltagex_ on Tuesday June 16, 2015 @02:38AM (#9724130)
Anyone tested Firefox/Chrome/Webview for Android?
Re:Favicon bug by vezzy-fnord on Monday June 15, 2015 @02:46PM (#9721206)
Interesting to see server-side JavaScript being used as an exploit language.
Re:Favicon bug by inglor on Monday June 15, 2015 @06:14PM (#9722475)
This is about as easy to do with every other language - I could have done it in C, or Python or PHP or Java or C# or whatever - node was just the lowest friction one for the PoC - all you ned is an HTTP server that lets you write dynamic requests - could have been bash even.
Re:Favicon bug by ghuntley on Monday June 15, 2015 @07:32PM (#9722866)

    ln -s /dev/urandom /srv/wwwroot/favicon.ico
Re:Favicon bug by nodesocket on Monday June 15, 2015 @08:37PM (#9723131)
Seems like an easy and logical fix for browsers.

   function fetchFavIcon() {
       if (favicon.fileSize > 1MB) { return false; }

       ...
   }