Firefox 1.0.3 Security

Firefox 1.0.3 has been released. Before reading on, go download it!

We fixed nine security fixes, three of them critical. That’s a total of 29 separate issues which were deemed worthy of a write-up since the release of 1.0. So does this add some weight to the argument that previously, Firefox only seemed secure because no-one has bothered to attack it?

Frank Hecker made an important point about this issue very eloquently in an email to drivers, which I’m sure he won’t mind me quoting here:

Yes, Firefox is a lot more popular now and has a much higher
profile. Yes, a lot of smart hackers are working now to break Firefox.
And what a surprise: These hackers aren’t making life miserable for
Firefox users, they’re working with us to make Firefox more secure. Why
is that? Because we pay attention to security bug reports, we try to treat people who find and report security bugs with respect, we invite them to work closely with us, we reward them for finding bugs (both with money and with credit), and most important: we actually fix bugs in a timely manner as opposed to sitting on them and treating security as just a potential PR problem.

Absolutely.

It’s Not A Bug, It’s A Feature…

This is a quote from a genuine “bug report”.

Motif is a form of Flash files that Double Click uses to serve rich media. The
motif ads use a .mta extension, and are basically the same as an .swf with
some addition ad tracking features.

It doesn’t appear that users can see motif files in Firefox, this is a serious
problem for advertisers that are trying to serve those ads to an audience that
is likely to download and use firefox.

Oh no! ;-)

Please don’t spam the bug.

New Newsgroups

We’re having another push to get new, better organised and spam-free Mozilla newsgroups set up. We have the hardware; we just need two things – someone to administer the server, and a definitive list of new groups.

We first made the list back in 2000 (believe it or not), when there was an extensive discussion. I updated it quietly myself in both 2003 and 2004, when we also sent out calls for an admin but for various reasons didn’t manage to make it happen. Since then I’ve been wary of re-opening the debate because I didn’t want to engender false hope. :-) Now, however, I believe there’s a real chance we can make it happen soon.

So, if you have news server admin experience, or know someone who does, get in touch. And please read the current list of suggested new groups and post your feedback.

IDN Coding Help Wanted

Darin is not going to have time before Firefox 1.1 to implement a mechanism to whitelist top-level domains where Unicode can be safely displayed, and I probably am not either. So someone who is comfortable hacking on Mozilla needs to, if Firefox 1.1 is going to have any IDN Unicode display support. I can provide guidance as to what needs to be done. Get in touch if you can help.

Auto Res of UNCOs Postponed (Slightly)

Despite my saying that there would be no more delay, wise Gecko-heads have persuaded me we should wait until we have a release with a recent Gecko to point people to, as Firefox 1.0.2 Gecko is almost a year old now. That will be Gecko 1.8b2, the Firefox and Thunderbird preview releases, scheduled for mid-April sometime. So we’ll do this ASAP after we ship those.

Script Keys

This is the second of my three ideas for the client-side mitigation of Cross-Site Scripting (XSS). It’s based on the same principle – that of the site owner specifying which scripts should be permitted and which not – but takes a slightly different approach.

Basically, the idea is that an HTTP header, Script-Key, defines a random string or “key” and only script labelled in some way with that string is allowed to execute. As the string will be different for every page load, injected script would not be correctly labelled and therefore would not be permitted to run.

The trick is trying to label the script in a way which allows the resulting markup to still validate. Having analysed the legal attributes of the <script> tag, here’s my current idea:

Content-Type: text/html
Script-Key: D3FC219A
<script type="text/javascript;key=D3FC219A">
...
</script>

Of course, that could also be a <script type=”…” src=”…”>.

That’s all very well, but how do you label e.g. script in event handler attributes like “onchange”? One idea would be just to say “you don’t”, and encourage use of proper DOM methods to add event handlers. Another would be to do something hacky like saying as long as the text of the script contained they key, it would be OK. So you could do:

<hr onclick="var foo = 'D3FC219A'; ..." />

Or, you could require the handler to set a navigator.scriptkey property to the correct key before you could do anything apart from assign variables. But that’s rather hacky too, and perhaps harder to implement, as you need to sandbox already-running script. (Either of these ideas would obsolete the content-type-parameter method.) Better suggestions welcomed. (We could define a new attribute, perhaps through the WHAT-WG. That might be cleaner, but it wouldn’t solve the event handler problem unless the attribute was made applicable to all tags.)

So how does this approach compare with Content-Restrictions? It’s a single layer idea – i.e. if it’s breached, and the attacker manages to e.g. inject script inside a block which is labelled as safe, then it’s game over. But it does reduce the attack surface. Content-Restrictions, on the other hand, is layered – if one restriction doesn’t prevent an attack, another one might. As a simple example, for “script=head,cookies=none”, even if you managed to inject script into the head, you couldn’t read cookies.

Mitigating XSS Attacks With Content Restrictions

Currently, the only defence against Cross-Site Scripting (XSS) attacks is server-side filtering of untrusted content. If that fails, the user agent is wide open. In absence of any information from the site designer, the user agent cannot make decisions about what script in the page to execute and what not to execute – it has to execute it all.

So, the perfect way to prevent XSS attacks would be for the user agent to read the website designer’s mind to determine which scripts embedded in a page were legitimate and which were malicious. In the absence of affordable and reliable mind-reading technology, and in consideration of the mental fatigue this would undoubtedly induce in web page authors, my new paper, “Content Restrictions“, presents the draft specification of a way for a site designer to explain his state of mind to the user agent by specifying restrictions on the capabilities of his content.

I hope to turn this into a draft RFC soon, so any comments would be extremely welcome.

Automatic Resolution of UNCONFIRMED Bugs

We are going ahead with the plan to automatically resolve some old UNCONFIRMED bugs. We will be taking the first step (issuing the warning) on the morning of Sunday 10th April, UK time (the middle of the night in the US).

This idea has been discussed previously on this blog. We’ve managed to address the major issues raised in that discussion; we’ve got a new EXPIRED resolution in Bugzilla, the language of the comments has been improved, and we’re excluding bugs with the ‘testcase’ keyword. I’m open to further suggestions, as long as they don’t delay the process. In the end, even if we can’t get it 100% right, the pros outweigh the cons.

Greasemonkey

It’s good to see Greasemonkey getting some press. It’s a fantastic idea. I demoed something similar, although not as capable, at EuroFoo in August last year. I called it “refacing” – a way of changing the face of particular sites to suite yourself. My simple example was defacing the SCO website so that all the references read “SCOundrels”. (Amusingly, the current Word of The Day on the front of www.sco.com is “Longevity”. Presumably they are referring to Linux rather than their own business.) But I never had time to take it forward and it languishes still on my laptop. I’m glad someone is making this happen :-)

You don’t actually need an extension to do something like Greasemonkey – you could do it all from a bookmarklet with appropriate server-side support. The bookmarklet injects a script which adds a DHTML popup to the page which gives a menu of available scripts. Of course, an extension gives much better UI, and is probably the correct solution for the long term.

However, the key problem with running scripts written by others in your session context for a website is security. There’s no real way to control a malicious user script once it’s running. Audit is your only line of defence. Be careful out there, kids.

Socially Responsible Browsing

Camino, the closely-integrated MacOS X browser, as a new website. One quote stood out:

[T]he Gecko rendering engine brings cutting-edge innovations and capabilities to users in a standards-friendly and socially responsible form.

Plagiarising shamelessly, wouldn’t that be a great slogan for Firefox? “Firefox. Socially responsible browsing.” It means your browsing experience will be (mostly) unsullied by popups and other annoyances. It means that sites web designers build to the standards will render accurately without too much need for hacks, workarounds, and the tearing-out of hair. It means your machine won’t get rooted and be used to DDOS or spam some innocent third party.

Socially responsible indeed.

Firefox Advert

A guy called Eric Edwards, a motion graphics student at the Savannah College of Art and Design, has done a rather cool television-style advertisement promoting the use of Firefox. It’s a student project which he’s planning to enter in an Adobe design contest.

The style reminds me of the original techno-industrial Mozilla artwork (like the banners).

If you like it, he’s looking for internships and jobs at the moment. And yes, he did get permission to use the trademark. :-)

Bugzilla 300,000 Bug Sweepstake

It’s that time again! :-) The bugzilla.mozilla.org bug database is about to hit another major milestone and, as is traditional, I’m running a sweepstake on exactly when that will be.

So, please email me giving the date and time you think bug 300,000 will be filed. Your entry should be on the first line of your email, and formatted as follows:

2005-04-01 11:09:46 – gerv@mozilla.org

All times are in ZST (‘Zilla Standard Time, a.k.a. PST Update 2005-03-17: make that ‘the time on Bugzilla timestamps’ – I forgot about Daylight Savings), and the email address should be your Bugzilla ID. If you prefer to be contacted on a different address, add that as well, below the entry line. We have ample graphs and charts to help you with your assessment.

Last time we did this, it got covered on Slashdot and lots of random people entered. But I think this should be a Mozilla community event so a) please don’t post this to Slashdot or any other non-Mozilla-focussed news source, and b) entrants must have a Bugzilla account on bugzilla.mozilla.org created before the end of February 2005, and which has done something useful in the past six months.

I’m obviously not going to check each entry, but I’ll check the “winners”, and keep discarding entries until I find the closest one which meets these criteria. The judge’s decision is final, and any funny business regarding the filing of bugs on or around the 300,000 mark will be frowned upon. The closing date for entries is midday ZST on Tuesday 22nd March. The winner will get some Mozilla or Firefox merchandise – exact amount and nature to be decided.

Lastly, please do not attempt to hijack bug 300,000 and turn it into some sort of “celebration” bug. It should be a legitimate bug report like any other, and dealt with as such. Let’s party somewhere more fun :-)