News for hackers. Stuff that matters.
Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday September 27, 2013 @06:54PM (#6460058)
I'm confused. This petition talks about cross-domain fonts, but it links to http://bugzil.la/475891 which has nothing to do with cross-domain issues. (It's about using different fonts for different Unicode characters.) Did you mean to link to http://bugzil.la/604421 instead?

Note that IE also applies same-origin restrictions to web fonts, and in fact this is required by the CSS Fonts standard [1], although this has been a somewhat contentious part of the spec [2]. The Blink team has discussed implementing this part of the spec too; Google's Tab Atkins believes that any new resource linking mechanism added to the web platform should be subject to same-origin restrictions by default [3] because this gives the platform better security characteristics.

The publisher of a web font can enable cross-origin use in all browsers by sending CORS headers [4].

[1] http://www.w3.org/TR/css-fonts-3/#same-origin-restriction

[2] http://lists.w3.org/Archives/Public/www-style/2011Jun/thread...

[3] https://groups.google.com/a/chromium.org/d/msg/blink-dev/TT9...

[4] https://developer.mozilla.org/en-US/docs/HTTP/Access_control...

Re:Dear Firefox, Fucking fix it already by jdorfman on Friday September 27, 2013 @08:16PM (#6460341)
Updated, thanks for pointing that out.

"The publisher of a web font can enable cross-origin use in all browsers by sending CORS headers."

I agree they can, but why do we need to add "Access-Control-Allow-Origin" header? What is the security risk? I am not being facetious, I really want to know.

Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday September 27, 2013 @08:44PM (#6460415)
So, you fixed the bug number, but what about my other points? Why single out Firefox when IE9+ has the same behavior and that behavior is required by the spec? Why don't you (or your CDN) use CORS? Why do you say this is "breaking the web" when thousands of sites are using cross-domain web fonts just fine in Firefox and IE (for example, any site that uses Google Web Fonts)?

Edit: I see you added more to your comment now.

There are a few reasons to require CORS for cross-domain font loads. One is so that you can use fonts that have single-site licenses in a way that satisfies the licensor, by not allowing other sites to use the font too without your authorization. Another is to prevent unintended data leaks where a malicious site can deduce things about a user based on whether that user can load a font from a different site, or based on the contents of that font. This isn't about a known attack, but a class of attack that we know from experience is likely to crop up in the future for any type of cross-origin resource load that we allow.

Re:Dear Firefox, Fucking fix it already by jdorfman on Friday September 27, 2013 @09:42PM (#6460536)
"One is so that you can use fonts that have single-site licenses in a way that satisfies the licensor, by not allowing other sites to use the font too without your authorization."

Good point but I believe that the only way to combat that particular edge-case is to use something like the valid_referers directive: https://gist.github.com/jdorfman/6737413

"This isn't about a known attack, but a class of attack that we know from experience is likely to crop up in the future for any type of cross-origin resource load that we allow."

You bring up another good point, but I am not talking about every cross-origin resource here, I am talking about Content-Type: font/ttf, application/x-woff, application/vnd.ms-fontobject & image/svg+xml.

Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday September 27, 2013 @10:19PM (#6460612)
Note: We can't actually restrict cross-origin requests based on Content-Type, since we don't know the Content-Type until we get a response. But, that quibble aside, I agree that allowing cross-origin requests just for @font-face does not open up any obvious holes. (If it did, Chrome and Safari users would be under attack already.)

However, it is the sort of thing that creative hackers are good at combining with other capabilities or exploits in order to get at data or code they shouldn't. The trend in web API design is to keep things same-origin by default, and give control to authors over whether they want to give other origins access to their data, because this keeps things secure by default and limits the number of tools that those creative hackers have at their disposal.

Not everyone at Mozilla agrees that this is the right solution. Anne van Kesteren (formerly of Opera, now a Mozilla employee), for example, favors adding a "From-Origin" request header that would remove the need for servers to add Access-Control-* headers in many cases (though it would not provide the same security properties by default):

http://annevankesteren.nl/2011/02/from-origin

http://www.w3.org/TR/2011/WD-from-origin-20110721/

Meanwhile, some Google employees have been major proponents of making things same-origin by default; read the Tab Atkin post linked above for example. This isn't really about sides; it's about constantly trying to find better ways to improve the web without compromising security. I won't claim the current solution is perfect; it's a starting point, that's all.

Re:Dear Firefox, Fucking fix it already by jdorfman on Friday September 27, 2013 @10:50PM (#6460683)
I think PG put it best back in 2000: http://www.amazon.com/gp/cdp/member-reviews/A3OCCXOG34ECBC/r...

Thanks for the debate, I learned a lot. =)

Re:Dear Firefox, Fucking fix it already by jdorfman on Friday September 27, 2013 @08:58PM (#6460441)
"Why single out Firefox when IE9+ has the same behavior and that behavior is required by the spec?"

I don't expect Microsoft to listen to their customers/users. I used to think Mozilla did but apparently not.

Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday September 27, 2013 @09:42PM (#6460534)
Hey, I'm part of Mozilla and I spent a significant part of my day researching this spec, and asking questions and listening to try and find out why your use case wasn't being met. Usually we prefer well-reasoned bug reports or emails as apposed to "Fucking fix it" on the HN front page, but we'll take feedback where we find it. :)

Also note that if you can't convince Microsoft to change this as well, then it doesn't matter too much what Mozilla does (at least for sites that need to support IE).

Re:Dear Firefox, Fucking fix it already by jdorfman on Friday September 27, 2013 @09:47PM (#6460553)
@mbrubeck I know you are part of Mozilla and I respect the work that you and Mozilla have done for the FOSS community, I just think Mozilla is off on this one issue.

"Usually we prefer well-reasoned bug reports or emails as apposed to "Fucking fix it" on the HN front page, but we'll take feedback where we find it. :)"

You know just as much as I know that email is dead ;)

Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday October 04, 2013 @10:28AM (#6495541)
Your first comment on your own petition was "Because every other browser supports cross-domain fonts except you" which is false. It looks like you filed this based on the blog post you linked to, which is three years out of date. (For example, it said S3 does not support CORS, which is no longer true.)
Re:Dear Firefox, Fucking fix it already by dbaron on Sunday September 29, 2013 @12:26PM (#6465585)
So we (Mozilla) are following the spec, which says what it does as the result of discussion/negotiation over a period of at least 4 years (roughly 2007-2011) involving browser makers and font foundries, both in terms of what browsers were willing to implement (not wanting something DRM-like to protect fonts) but what would lead to more font foundries being willing to license commercial fonts for use on the Web. So following the spec here isn't about blindly honoring some piece of paper; it's about honoring the result of a negotiation process that we participated in. WebKit unilaterally ignored this agreement, though it sounds like Blink may well change to honoring it.

Many (but not all) of us believe that same-origin by default is also the right thing for security, that it should be the default for new types of resource linking on the Web, and that not having same origin restrictions for things like images was a pretty serious mistake that we're still paying the security costs of (for example, with canvas image tainting).

Re:Dear Firefox, Fucking fix it already by jdorfman on Monday September 30, 2013 @09:30PM (#6473505)
@dbaron, I appreciate your insight. Makes sense even though, at this time, I do not fully agree with the spec. I guess time will tell.
Re:Dear Firefox, Fucking fix it already by drakaal on Friday September 27, 2013 @07:16PM (#6460140)
Google Chrome let's you do something Unsafe that none of the other browsers let you do, and you want the safe browser broken so it does the dangerous thing? This doesn't seem like a good idea to me.

You can use fonts from places that let you use them. But this offers both a minimal copy/hot link protection, so that I can't just steal a font from somewhere, or use someone else's hosted font unless they let me.

I don't think Firefox should "fix" this as it seems to be a good decision for preventing all sorts of bad things.

Re:Dear Firefox, Fucking fix it already by __david__ on Friday September 27, 2013 @06:57PM (#6460070)
I assume there is not an arbitrary reason for this--does Mozilla consider fonts to be dangerous (security-wise)?

Also, do you want to load the fonts across domains so they can be hosted on CDNs?

Also, this is a terrible, non-descriptive title.

Re:Dear Firefox, Fucking fix it already by gcb0 on Friday September 27, 2013 @07:09PM (#6460111)
this is probably astroturfing by google. Who provides both a site with free fonts and a browser without those restrictions. Plus we know they have use for those random resource requests since they also provide 8.8.8.8 and other similar cdn for js libraries. Also they killed 3+ attempts at disbling referrer from the chromium comunity.

or i am just paranoid.

Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday September 27, 2013 @07:10PM (#6460113)
Google Web Fonts uses CORS, so it works cross-origin in Firefox and IE.
Re:Dear Firefox, Fucking fix it already by gcb0 on Wednesday October 02, 2013 @06:15PM (#6485789)
exactly. did you even read my paranoid theory? :)

all they want is that FF and IE be as permissive as Chrome so they can track everyone via cross-domain font requests. As they already do with DNS and free CDN for js libs.

Re:Dear Firefox, Fucking fix it already by mbrubeck on Friday October 04, 2013 @10:14AM (#6495468)
But my point is they can already do this. They don't need IE or Firefox to change anything because IE and Firefox already support cross-domain fonts.