I’m off to FOSDEM, giving a couple of talks (on the MoFo and Bugzilla) in the Mozilla Developers Room, and hopefully meeting a lot of European Mozilla hackers. Hope to see you there :-)
Category Archives: Hacking
RMS Blog
I’ve just discovered RMS’s blog. For a man who explains things verbally so well, and who writes great essays, he has a very stilted style in day-to-day blogging. Each pair of sentences are exactly the same mental distance apart, and it’s a fairly short distance. The combined effect is like reading through treacle.
Entity Parsing
I’ve discovered an interesting HTML parsing foible. HTML entities, such as &, are used to encode special and extended characters in HTML. But, as web page authors are sloppy, both IE and Firefox attempt to “do the right thing” when faced with unterminated (no semicolon) HTML entities like:
“I used Sun’s java compiler”
However, if HTML sanitisers don’t do exactly the same thing when decoding, you may be able to slip some script past them. So, for example:
<img src="javascript:alert('Oops');">
could be the name of a valid image on the webserver. However, IE and Firefox will decode it to:
<img src="javascript:alert('Oops');">
IE executes the JavaScript immediately; you need to do a View Image for Firefox to (not sure why). Perhaps this isn’t a big deal, but I have no idea whether any commonly-used HTML sanitisers would fall for this one…
In the Matter of Component Architecture
In the Matter of Component Architecture is a fantastic piece on the value of code reuse which appears to have been written merely as an email to a mailing list.
Software as it is currently being developed provides so much value relative to its costs that we as practitioners of this medieval-class craft can get away with practices that would not be tolerated by a Taiwanese manufacturer of toasters.
A Plan For Scams
“A Plan for Scams“[0] is a summary of my views on the action required to tackle the phishing problem. I believe a co-ordinated effort from browser and mail client vendors, website owners, ISPs, domain registrars and certificate authorities is necessary, and I outline what steps each of them should take.
This document does have something to say about IDN homograph attacks, but is by no means solely focussed on that.
[0] With apologies to Paul Graham.
IDN Spoofing Strategy
After much discussion, staff@mozilla.org and drivers@mozilla.org have agreed a short-term strategy for dealing with the recently-publicised issues relating to IDN and domain spoofing.
First off, we want to make it clear: we support Opera’s position that this is a registrar/registry problem. These issues were known when IDN was proposed, guidelines were developed for avoiding the problem by restricting registrations, and the DNS registration organisations need to step up and implement them. (Certificate Authorities should also, as a simple matter of acting responsibly, not issue certs for domains which are part of a homographic block registered to two or more entities.)
However, we also have a duty to protect our users. So, in the mean time, the enableIDN preference will be set to “false” in Firefox 1.0.1 and Mozilla 1.8 beta, including all official localisations. An XPI will be made available to turn it on again; this XPI will make the risks of doing so clear. This means that by default, links to IDN domains which use the Unicode rather than the punycode form for the href will fail, and the browser will display any IDN domain visited in its raw form.
In the future (Firefox 1.1 and beyond) we hope to be able to turn IDN back on again. We may be able to find a way to turn it on selectively for those TLDs which have a demonstrable record of good practice – but we can’t promise to do that. It partly depends on how much resource maintaining a white or black list would take. (To help with that decision, please tell me of any instances where the registration of two homographic domains to different entities has happened in TLDs other than .com.)
So if people want to see full, unrestricted IDN back in Mozilla and Firefox, the best way is to put pressure on the world’s registrars and registries to fulfil their obligations to their customers – both domain owners and Internet users – and commit to implementing the ICANN guidelines.
Clever Licensing Hack
Trolltech have recently dual-licensed QT for Windows under the GPL (as reported by scc). Previously, only the non-Windows versions were available under the GPL. Reading their FAQ on the subject, I did notice a clever licensing hack.
Q: I want to dual license my software too! That means I can use the Open Source edition for development, right?
A: No. In order to write software that will be sold or licensed commercially, in addition to open source, all of your programmers will need a commercial license from the outset of the development phase.
But how can this be? The GPL allows you to use software you’ve obtained under it in any way you choose. “The act of running the Program is not restricted.” How can Trolltech prevent you from developing your app against the GPL edition, and only buying a commercial licence when and if you want to release it?
Here’s the trick:
If you use the Open Source edition of Qt, you can only publish the software under the GPL. Trolltech’s commercial license terms do not allow you to develop any proprietary software using the Open Source edition.
The commercial licence terms presumably say something like “you can’t use this license to distribute code you originally developed against the GPL edition”. So they use the commercial licence terms to restrict the use of the GPLed version. Clever. And legal.
Non-Native Widgets in IE
You heard it from the horse’s mouth – IE doesn’t use standard Windows controls. So all those who continue to complain about how XUL “re-invents the wheel” by doing its own widgets, and how that has to be the cause of our allegedly poor performance (did you start Firefox recently?) can finally pipe down.
Raymond Chen is a Microsoft guy who writes a fascinating technical blog called The Old New Thing. While hoping I never have to use any of the technologies he discusses, he writes so well and comes out with such great historical nuggets that it’s essential reading.
Phishing – Browser-based Defences
The recent Shmoo Group punycode phishing demo has caused a lot of debate on the topic of phishing. In fact, domain registrars were warned about this problem (guideline 3, subsection b) when IDN was invented, and many registrars (for example, the Japanese) have implemented sensible controls to counter the problem of homographic domains.
However, it’s caused me to crystallise a number of thoughts I’ve been having on the subject into a paper – Phishing – Browser-based Defences – which covers what we can be doing in the browser space to mitigate the phishing problem. It lists the qualities of a good solution, analyses some of the suggestions that have been made, and then makes three of its own.
Please let me know what you think.
Introducing ‘Grout’
I’ve just released version 1.0 of Grout, a program which solves certain classes of tile-placing, edge-matching puzzles, such as that illustrated here. I originally wrote it to solve specifically six-sided puzzles for a programming competition back in 2001, but then generalised it when I came across a four-sided puzzle at a friend’s house.
I don’t know if anyone else will have a use for it…
So What Is a “Derived Work”?
The world of software licensing is, to be honest, a fairly dull one. Lots of reading and interpreting of legal documents, analysis of the meaning of terms, and negotiation with copyright holders.
You would be forgiven for thinking, perhaps, that discussing what is or is not a “derived work” under copyright law (a fairly key point with regard to the GPL, for example) is not the most exciting way to spend your evenings.
However, things can liven up occasionally, as they did last week on debian-legal, where a contributor who was frustrated at going around in circles on an argument over the use of the GPLed Kaffe VM to run the CPLed Eclipse IDE used a fairly graphical but memorable analogy to explain what a “derived work” actually is. I can’t say I’ll ever be using it myself, but it’s an amusing read.
Text Insertion Technology
I answer a load of email, often with the same text. (People just don’t read FAQs). It would be great to press a button in Thunderbird and get a menu of insertable boilerplate text. (A KDE application would also work.) Anyone got any ideas?
I used TagZilla for a bit, but I didn’t have time to hack it to not invoke itself on message send. And the dialog doesn’t support keys such as Enter to insert the selected text, which is rather annoying.
11,915 Registry Entries?
Window spyware is getting installed via the “download DRM licence” feature of Windows Media Player files distributed over P2P networks (from Slashdot).
“On a fresh test computer, I pressed Yes once to allow the installation. My computer quickly became contaminated with the most spyware programs I have ever received in a single sitting.
All told, the infection added 58 folders, 786 files and an incredible 11,915 registry entries to my test computer.”
I don’t have much sympathy for people who break the law and end up having their computer trashed as a result. But that’s a mindblowing amount of spyware. Why on earth does a DRM system involve the execution of remotely-downloaded code?
Introducing ‘Hendrix’
‘Hendrix’ is a new feedback-collecting mechanism for mozilla.org, designed for people who just want to leave a quick comment or rant, and can’t be bothered with Bugzilla. The idea here is to lower the barrier to giving feedback, and simultaneously try and keep some of the less useful bugs out of Bugzilla.
There’s a test installation here.
Hendrix is a web-to-news gateway, currently posting to the newsgroup netscape.public.mozilla.test, so this is where you should look for the form output. When it’s deployed, it will eventually post to more appropriate group. The two current candidates are netscape.public.mozilla.wishlist, and netscape.public.beta.feedback which, while the name isn’t massively appropriate, does have the advantage of being abandoned. Ideas welcomed.
I haven’t worked on the styling; it would be great if someone would do a stylesheet for it, perhaps so it fitted in with the mozilla.org look. Everyone can have a go – pass the “&stylesheet=<url>” parameter. And yes, I have protected this against XSS. ;-)
If you want to play with the code, just check mozilla/webtools/hendrix out of CVS. It requires ExecCGI turned on, and the Template Toolkit and Email::Send Perl modules installed.