Firefox Code Base Analysis

Mozilla Fire­fox is an open-source web browser, that has gath­ered just over 11% of the inter­net browser mar­ket, an impres­sive move­ment for a browser that has to be phys­i­cally down­loaded onto a person’s com­puter and is not known out­side of tech/geek cir­cles. Few peo­ple install it them­selves out­side of these cir­cles unless they know some­one who has set up their com­puter and installed Fire­fox for them. (Side Note – I use Opera, another excel­lent open-source browser pri­op­er­tary but free to use browser that has plenty of built in secu­rity fea­tures, one of the main rea­sons to switch to Firefox.)

An open-source pro­gram is a soft­ware pro­gram that is devel­oped not by a com­mer­cial com­pany such as Microsoft or Adobe or Apple, but rather is one that is devel­oped, coded, and main­tained by a com­mu­nity of users. All of these users develop the code, report on errors and work to fix the errors and con­stantly improve the pro­gram. Mozilla is a non-profit cor­po­ra­tion, so it makes no profit from Fire­fox being used, and the major­ity of the devel­op­ers are peo­ple out­side of the com­pany. This does sev­eral things gen­er­ally to open-source pro­grams, one is that it makes them quicker to respond to changes in the mar­ket, as the peo­ple who write the code are already at the fore­front of any tech­nol­ogy waves, they quickly make sure that the browser is com­pat­i­ble for all new tech­nolo­gies. Also it gen­er­ally pro­vides a more secure and resilient pro­gram, which seems like back­wards logic – Wouldn’t a pro­gram whose source code is view­able actu­ally be more open to attack.

In fact, in the­ory and in prac­tice that the oppo­site is actu­ally true. This based on a fun­da­men­tal idea behind many Web 2.0 apps and the open-source move­ment and to some extent democ­racy – the wis­dom of the crowds. This the­ory says that when you get a ton of peo­ple all look­ing at the same thing and all exam­in­ing it the bad stuff, what­ever it may be from a bad code to a bad news arti­cle in the case of Digg, is removed. Think about it, how many times have you just needed one other per­son to check over your work to be see what you are doing, writ­ers do it, engi­neers do it, accoun­tants do it, every­body does it. Now imag­ine that you have at least a dozen (on the small­est open-source projects) to sev­eral hun­dred (on the largest open-source projects) exam­in­ing what you put into the pro­gram. All of sud­den, all those care­less mis­takes that you make are elim­i­nated, because not is it you and maybe one or two other peo­ple check­ing your work but instead tons of peo­ple are check­ing your work for you as you check their work. This is the inher­ent power of the open source movement.

How­ever as we have found far too often no sys­tem is per­fect, and Fire­fox is also prone to errors in it’s source code. G2zero.com exam­ined the source code of the Fire­fox browser and found that there were 655 defects and 71 poten­tial secu­rity vul­ner­a­bil­i­ties in the source code. Now that may seem like a lot to those of you who do not code pro­grams, but for a pro­gram of this scale and mag­ni­tude that is a great num­ber. No pro­gram will ever get rid of errors or secu­rity issues, think about even Mac OSX which rou­tinely touts the oper­at­ing system’s inher­ent secu­rity. Apple releases patches and secu­rity bul­letins for OSX too, the same as Microsoft issues patches for Win­dows every 2nd Tues­day of the month, what is known as Secu­rity Tuesday.

The ques­tion here is whether or not auto­matic soft­ware tools that exam­ine code and look for errors are worth deploy­ing. There are a great many who say, yes, because it helps you to find the errors and a com­puter won’t skip over things that a human would ignore. Whereas another great many say, no because a com­puter sees things that just don’t mat­ter a human knows the code and knows whether or not an error actu­ally mat­ters in the code or can just be ignored. I have to take the mid­dle road on this, you should test and error proof the code your­self, a com­puter pro­gram can give you a place to start but it does not under­stand the whole code the same way a human does. The best thing is to do unit tests on your code and deter­mine that the code works even when given invalid data. A secu­rity hole will always exist, an error can always be found, but does the pro­gram work reli­ably and effi­ciently is pos­si­bly the bet­ter ques­tion to ask. The gen­eral pub­lic doesn’t care how many secu­rity holes a pro­gram has, they just want it to work. This is not to say they pro­gram­mers should leave their code open to attack, rather the empha­sis should be on pro­duc­ing qual­ity code that in the words of Apple “just works”. When qual­ity code is pro­duced that “just works” the secu­rity comes hand in hand.

Edit — Sept. 16, 2006 10:22 pm, Fixed a mis­take in my post­ing regard­ing the nature of the Opera web browser.

Comments are disabled for this post